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: Fri, 7 May 2021 21:46:15 +0200 Message-ID: References: <83o8dv9e8s.fsf@gnu.org> <10473f20-aad5-a4a2-528e-088ac14bfb74@ims.co.at> 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="24349"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:89.0) Gecko/20100101 Thunderbird/89.0 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 Fri May 07 21:47:25 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 1lf6RY-0006Bm-0M for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 May 2021 21:47:24 +0200 Original-Received: from localhost ([::1]:41640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lf6RX-0004vo-3p for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 May 2021 15:47:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45404) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lf6RC-0004vY-Dk for bug-gnu-emacs@gnu.org; Fri, 07 May 2021 15:47:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34090) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lf6RC-0004yW-6D for bug-gnu-emacs@gnu.org; Fri, 07 May 2021 15:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lf6RC-0002WP-4i for bug-gnu-emacs@gnu.org; Fri, 07 May 2021 15:47: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: Fri, 07 May 2021 19:47: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.16204167849679 (code B ref 48129); Fri, 07 May 2021 19:47:02 +0000 Original-Received: (at 48129) by debbugs.gnu.org; 7 May 2021 19:46:24 +0000 Original-Received: from localhost ([127.0.0.1]:45634 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lf6QZ-0002W3-GI for submit@debbugs.gnu.org; Fri, 07 May 2021 15:46:23 -0400 Original-Received: from mail.ims.co.at ([81.92.245.88]:44537) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lf6QX-0002Vt-TG for 48129@debbugs.gnu.org; Fri, 07 May 2021 15:46:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ims.co.at; s=ims; h=message-id:date:mime-version:subject:from:to:cc: references:in-reply-to:content-transfer-encoding; bh=k+RwJvm3tx/9t7+OwohGbQJTXtr0dCPN9QSvaCFvW9U=; b=BPGTAaTKHJmyDmDAcTI5nmd0KEP1RuptscBSgOMiwVsHdHCsLsSQx7pk g6w80Mi2pOGqGEuChnYkZTI7w4uiSFJv5kNyHk1p5MzZEGEb3DYRNWORa LjdWZ/SCnqtz2uXvDHiVH/mBa+qcGQjfWFaeADOLVGhMAotmBfsS02cuf 4=; IronPort-SDR: Lopj8rTxu+GoG4HUCouZZqV9zQnBHMuDtN7p7PX2bYoqPyih4wLWCCx0zOT7tkbR7tmCKhzcyn yzf3FpcQmafw== X-IronPort-AV: E=Sophos;i="5.82,282,1613430000"; d="scan'208";a="918482" Content-Language: en-US In-Reply-To: <10473f20-aad5-a4a2-528e-088ac14bfb74@ims.co.at> 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:205960 Archived-At: On 5/2/21 12:19, Thomas Hisch wrote: > 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' b= y >>> writing to a pty (via stdin) and avoiding that this subprocess writes >>> ANSI escape sequences to stdout. This use-case is needed by magit, whic= h >>> 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"))) > Eli can you tell me if you meant that we should use make-process in combination with make-pipe-process? 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