From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thomas Hisch Newsgroups: gmane.emacs.bugs Subject: bug#48129: 28.0.50; Per file-handle (stdin, stdout and stderr) process-connection-type variable Date: Sun, 2 May 2021 12:19:21 +0200 Message-ID: <10473f20-aad5-a4a2-528e-088ac14bfb74@ims.co.at> References: <83o8dv9e8s.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37462"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 Cc: 48129@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 02 12:27:16 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ld9Jk-0009dX-Cp for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 May 2021 12:27:16 +0200 Original-Received: from localhost ([::1]:57632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ld9Jj-0003ch-Bl for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 May 2021 06:27:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47830) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ld9Di-0000Pb-OO for bug-gnu-emacs@gnu.org; Sun, 02 May 2021 06:21:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58717) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ld9Di-0005f9-Ge for bug-gnu-emacs@gnu.org; Sun, 02 May 2021 06:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ld9Di-0003HT-D7 for bug-gnu-emacs@gnu.org; Sun, 02 May 2021 06:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Thomas Hisch Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 May 2021 10:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48129 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 48129-submit@debbugs.gnu.org id=B48129.161995084512579 (code B ref 48129); Sun, 02 May 2021 10:21:02 +0000 Original-Received: (at 48129) by debbugs.gnu.org; 2 May 2021 10:20:45 +0000 Original-Received: from localhost ([127.0.0.1]:42030 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ld9DQ-0003Gp-Vq for submit@debbugs.gnu.org; Sun, 02 May 2021 06:20:45 -0400 Original-Received: from mail.ims.co.at ([81.92.245.88]:42352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ld9DP-0003Gi-6B for 48129@debbugs.gnu.org; Sun, 02 May 2021 06:20:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ims.co.at; s=ims; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=yU18ZxK4fASSQOkPGJgIkTh+PCFmBB2R7Iif17N/LJg=; b=STSXTckmwYc/UIzSsK8p+AYMPPLhzFNwhPUHfE+rO8lD8CDSBuaA8HnZ kcfXIucTvN1gB2avR6+Bso9jxEAY3l7xAqgkvoGciVmsOO7iLxBj9I2gC U0wE89xFYjf8MeDDFW9/m0eZEH8a4Yu3if2NnUbBZEDHTwyJ23Tk+PMSf w=; IronPort-SDR: w01URzJGkOuTJyPyuzXcPz54s1LUXDL2CYdvNLQrRUoBaMbG02A8IuRwjfjp3t9aCDT49wSFu0 wGSWXP9bYX0Q== X-IronPort-AV: E=Sophos;i="5.82,267,1613430000"; d="scan'208";a="906258" In-Reply-To: <83o8dv9e8s.fsf@gnu.org> Content-Language: en-US X-Originating-IP: [77.118.196.177] X-ClientProxiedBy: srv-xchg-02.ims.co.at (10.120.20.62) To srv-xchg-02.ims.co.at (10.120.20.62) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:205420 Archived-At: On 5/1/21 8:09 AM, Eli Zaretskii wrote: >> From: Thomas Hisch >> Date: Sat, 1 May 2021 01:10:10 +0200 >> >> >> I would like that the configuration options of the three file >> handles (stdin, stdout and stderr), when a new process is created >> in emacs, are improved. What I'm specifically asking for is to >> add support for individually specifying for each file-handle >> whether it should be connected to a pty or not. Currently the >> value of the process-connection-type variable applies to all >> three file handles at once, which leads to a problem with the >> following use-case: >> >> Usually a program outputs ANSI escape sequences when its stdout >> file-handle is connected to a pty. It is currently not possible to >> communicate with a subprocess that is created by `start-file-process' by >> writing to a pty (via stdin) and avoiding that this subprocess writes >> ANSI escape sequences to stdout. This use-case is needed by magit, which >> currently doesn't have support for displaying ANSI escape sequences but >> it needs to communicate with it's started subprocesses via a PTY >> (https://github.com/magit/magit/issues/3549). > > We have make-pipe-process; can't you solve your problem by connecting > your process's stdout to such a pipe-process? If not, why not? > Thx Eli for the fast reply! I had to study the docs of make-pipe-process and make-process to understand what you mean. However, I'm not fully sure if I fully get what you mean. AFAICS the pipe process which is returned by make-pipe-process can be passed to the :stderr keyword argument of make-process. Is that what you head in mind? According to the docs of make-process, process-connection-type is ignored if :stderr is passed to make-process: > This parameter and the value of =E2=80=98process-connection-type=E2=80= =99 are ignored if a non-=E2=80=98nil=E2=80=99 value is specified for the =E2=80=98= :stderr=E2=80=99 parameter; in that case, the type will always be =E2=80=98pipe=E2=80=99. What I want is that stdout and stderr are connected to a pipe but stdin is connected to a pty. Here is the new test script that I used (let* ( (stderr-buffer (get-buffer-create "*stderr*")) (stderr-proc (make-pipe-process :name "stderr" :buffer stderr-buffer)) (process-buf (get-buffer-create "*temp*"))) (make-process :name "isatty" :buffer process-buf ;; it is not possible to pass the output of make-pipe-process to :buffer :connection-type 'pty ;; unfortunately ignored if :stderr is used :stderr stderr-proc :command (list "/tmp/output-isatty.py"))) Best regards Thomas Diese E-Mail enth=C3=A4lt vertrauliche und/oder rechtlich gesch=C3=BCtzte I= nformationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail i= rrt=C3=BCmlich erhalten haben, informieren Sie bitte sofort den Absender un= d vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte We= itergabe dieser Mail ist nicht gestattet. This e-mail may contain confidential and/or privileged information. If you = are not the intended recipient (or have received this e-mail in error) plea= se notify the sender immediately and destroy this e-mail. Any unauthorized = copying, disclosure or distribution of the material in this e-mail is stric= tly prohibited. IMS Nanofabrication GmbH FN: 208021 p, FB-Gericht: Wien; Sitz: Schreygasse = 3, 1020, Vienna (Austria),Tel. +43 1 214 48 94; E-Mail: imsoffice@ims.co.at= ; DVR-Nr: 0374369; www.ims.co.at