From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#56025: [WIP PATCH] 29.0.50; em-extpipe-test-2 times out on EMBA and Cygwin Date: Sun, 17 Jul 2022 10:44:26 -0700 Message-ID: <5f9b3680-d840-cc1d-14a6-1c8f71c30e62@gmail.com> References: <8e21db9c-0100-998e-f280-81304e7ff61a@cornell.edu> <17d41105-b006-f9ad-af0b-ece84a7f5248@gmail.com> <040b3a36-459b-a94d-f879-7f45aac50bda@cornell.edu> <83sfnud26o.fsf@gnu.org> <96e47ba7-efaa-b6df-dd98-60f09068e68c@gmail.com> <874k097lbh.fsf@melete.silentflame.com> <8735frmjrr.fsf@athena.silentflame.com> <4676f52c-4758-38df-f0f4-dbcb5d848c1b@gmail.com> <8735fr2kq6.fsf@melete.silentflame.com> <10cf6a90-f86a-b0df-4dc2-c258b7494158@gmail.com> <18e79c02-3a2a-77d1-3798-33711f52d6b9@cornell.edu> <19c66901-2eeb-1f40-17a4-4ed54827e065@gmail.com> <5990de80-63a5-ac9b-1a11-c814aa9e38f2@gmail.com> <3779ea08-f481-5fb5-3257-ca9fa7c604bc@cornell.edu> <60cf587b-5d83-31d6-f0af-56979b221425@gmail.com> <83bktoqnru.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39215"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 56025@debbugs.gnu.org, spwhitton@email.arizona.edu, kbrown@cornell.edu To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 17 19:45:28 2022 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 1oD8Kd-0009xg-Kx for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 Jul 2022 19:45:27 +0200 Original-Received: from localhost ([::1]:54938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oD8Kc-0003DY-26 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 Jul 2022 13:45:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oD8KG-0003CW-24 for bug-gnu-emacs@gnu.org; Sun, 17 Jul 2022 13:45:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50738) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oD8KE-0000Sz-3x for bug-gnu-emacs@gnu.org; Sun, 17 Jul 2022 13:45:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oD8KE-0001qc-0N for bug-gnu-emacs@gnu.org; Sun, 17 Jul 2022 13:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Jul 2022 17:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56025 X-GNU-PR-Package: emacs Original-Received: via spool by 56025-submit@debbugs.gnu.org id=B56025.16580798767057 (code B ref 56025); Sun, 17 Jul 2022 17:45:01 +0000 Original-Received: (at 56025) by debbugs.gnu.org; 17 Jul 2022 17:44:36 +0000 Original-Received: from localhost ([127.0.0.1]:48497 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oD8Jo-0001pl-1h for submit@debbugs.gnu.org; Sun, 17 Jul 2022 13:44:36 -0400 Original-Received: from mail-pg1-f178.google.com ([209.85.215.178]:43627) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oD8Jl-0001pS-33 for 56025@debbugs.gnu.org; Sun, 17 Jul 2022 13:44:35 -0400 Original-Received: by mail-pg1-f178.google.com with SMTP id h132so8736087pgc.10 for <56025@debbugs.gnu.org>; Sun, 17 Jul 2022 10:44:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=Bl+Z1EuqDj8vaXaGCnA//zm8Pc8jw/uxhFmSBF7AWuU=; b=eTPe51W1Lqm22Wfgg9FSzQzcnrq+lptdbZxizfYvFcvhhNWE28+laHwWUVo/OxWNVL 8+GICf4O3HCSjtw/wGu/UJ50o1iNt/GlJW859iloloFiWA6QzyOmGvrFt6rUSuEPn7cJ WvVJuC6EVSl7TosZRvM3ihPwcRrtFk3YE80rNz72znV5o3Sff+7hcJ0dwKcuBVOUGQ7d cXDaANS8ROKgeOuzVEMHO778yM8EMTi8xxtnMQLbHAkhoGatVzsWu17hqlC9STBJ/HeM wT44BI6YCQJSout35YUzaMDjsCzkyluNwcV48GP1LO4N+AUFoCUn1HRfDjVYQ8/PNUQr 5VYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Bl+Z1EuqDj8vaXaGCnA//zm8Pc8jw/uxhFmSBF7AWuU=; b=PjATij/Mq4wuB/2TiwwmKWdlMqlnJvf3y9JOwFe8sFnFS7ufomtfsCP51PiXzfAAYk VXjbNK05q0s+OQD0hShA6pZHDnAuYr1WC/WcLjvEUsEdlayoOY/TFqG6a5v10fIrBNDS Lu6dvL2g4+4qaFkXc9WYguX+vnVLAgYn56u+i/GWBt/20zpbCWZxErMM/mzVsm/oypCm 89kIJIoPxtYIrt0p4RxJsAHMp8KjU/pWA6NcMomq9o/TdyW5b9bRMEee+0qdA3ugo7kE 9Hb8p+403lwcfVZcZhzyo6lxFAKts8gPqeWJfmcPG9MnCgM8ZVzTs1ABV1GVkDluWxLm +hxQ== X-Gm-Message-State: AJIora/rF/rAJAn/NboUyZwNZ2c5osOR2SyAkhNvUBUsexC4Qr0B2DtQ 3Ylk09Z3RDf/zMAzBvHtVgw= X-Google-Smtp-Source: AGRyM1sygM0iqFf6lhx8hO/2BWe/wA8HCLjNEBrPATsyzy3yzexIR7mgY3OuNerxrZ91XxEoSwP9EQ== X-Received: by 2002:a05:6a00:1590:b0:52a:eb00:71dc with SMTP id u16-20020a056a00159000b0052aeb0071dcmr24945797pfk.64.1658079866088; Sun, 17 Jul 2022 10:44:26 -0700 (PDT) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id gg15-20020a17090b0a0f00b001ec932d7592sm7460974pjb.9.2022.07.17.10.44.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 17 Jul 2022 10:44:25 -0700 (PDT) In-Reply-To: <83bktoqnru.fsf@gnu.org> Content-Language: en-US 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:237290 Archived-At: On 7/16/2022 11:03 PM, Eli Zaretskii wrote: > Could you please describe the main ideas of the changeset? It is hard > to be sure I understand what you are trying to do by reading the > patch. Sure. I mentioned it briefly earlier in the thread, but a more-complete summary would probably help. Normally, Eshell connects programs in a pipeline like "foo | bar" by setting a process filter for "foo", and inside that filter, (eventually) calling `process-send-string' for "bar". In most shells, you'd expect that connection to be a pipe, but in Eshell, the processes are created with a PTY connection by default. My patch adds support for `make-process' to use a PTY only for the child process's stdin or its stdout (in addition to the preexisting behaviors of PTY for both or neither). This then lets Eshell request a pipe for foo's stdout and bar's stdin, while using PTYs for foo's stdin and bar's stdout: Before: [pty 1] -> foo -> [pty 1] -> Eshell -> [pty 2] -> bar -> [pty 2] After: [pty 1] -> foo -> [pipe] -> Eshell -> [pipe] -> bar -> [pty 2] This should make Eshell behave quite a bit more similarly to other shells, which will hopefully reduce the number of bugs like this one. This change also allowed me to remove the workaround for bug#1388. In that bug, there was an issue where this command didn't work[1]: *echo 1+1 | bc Before the fix for bug#1388, "bc" would have seen that its stdin was a PTY, and then started an interactive session. Bug#1388 fixed this by adding `eshell-needs-pipe-p' to identify specific programs that need a pipe connection when being piped to like the above. With my patch here, that workaround won't be necessary anymore, since programs in a pipeline will be connected via pipes. (Note that technically, this pipe connection is indirect, since there's one pipe from foo to Emacs, and another pipe from Emacs to bar.) This patch should hopefully fix the issues on Cygwin (as described in this bug) because, when using pipes to connect programs, the behavior should be more consistent across multiple platforms. [1] I'm using "*echo" here to use /bin/echo so that it writes a newline. Eshell's built-in echo doesn't write a newline by default.