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#56013: 28.1; "gio open" and "xdg-open" fail silently under eshell Date: Fri, 17 Jun 2022 11:25:58 -0700 Message-ID: <292942b6-4a7f-0002-2af4-210b32612ba1@gmail.com> References: <87h74kes5l.fsf@gnus.org> <87czf88yre.fsf@igel.home> <87ilozbivd.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38781"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56013@debbugs.gnu.org, Jeff Kowalski To: Lars Ingebrigtsen , Andreas Schwab Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 17 20:27:11 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 1o2GgZ-0009vP-9b for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 17 Jun 2022 20:27:11 +0200 Original-Received: from localhost ([::1]:37052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o2GgY-0000IU-1r for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 17 Jun 2022 14:27:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36376) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2GgQ-0000F7-RB for bug-gnu-emacs@gnu.org; Fri, 17 Jun 2022 14:27:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53021) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o2GgQ-0007wd-IY for bug-gnu-emacs@gnu.org; Fri, 17 Jun 2022 14:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o2GgQ-0007Yk-Ae for bug-gnu-emacs@gnu.org; Fri, 17 Jun 2022 14:27: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: Fri, 17 Jun 2022 18:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56013 X-GNU-PR-Package: emacs Original-Received: via spool by 56013-submit@debbugs.gnu.org id=B56013.165549037029000 (code B ref 56013); Fri, 17 Jun 2022 18:27:02 +0000 Original-Received: (at 56013) by debbugs.gnu.org; 17 Jun 2022 18:26:10 +0000 Original-Received: from localhost ([127.0.0.1]:46918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o2GfZ-0007Xf-Ts for submit@debbugs.gnu.org; Fri, 17 Jun 2022 14:26:10 -0400 Original-Received: from mail-pl1-f181.google.com ([209.85.214.181]:39496) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o2GfU-0007X7-PS for 56013@debbugs.gnu.org; Fri, 17 Jun 2022 14:26:08 -0400 Original-Received: by mail-pl1-f181.google.com with SMTP id a17so2573402pls.6 for <56013@debbugs.gnu.org>; Fri, 17 Jun 2022 11:26:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:from:to:cc:references:message-id:date:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=YGuF6e2D0WuhyAdagA8pFKd+A4j/25322gAXfWBpPfY=; b=beAA1Z9IdmwXfH35W9/K6AAUVODeqRTixM5WO5YXyItBla6LHnoo/j0HufC5caXIsn 6fYMit/4mtN0HFx+nQoP60vhtiXtTi3CaFP0iAdeF/kmrQJyrw9hx53AOyLl5yqmUmni VmIIkvYLHvuwYkJvCGRcBB4ldEe6mCvymmvkMynx5z/QkzeegMMvaO+VxLXeC9Ix3si1 IAamFmp2GkaJYiLMFVT19ZCRxbIAZn1JHjcgt3VSZAwB/DAD9ss02YLNgcIUuEMgYgPE 8rlHoPIGRRC05lxZkKU9WgD/jRvt/mKgP12SwquzBfDNw2OA02tb7abpTikxIDgXX92k etlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=YGuF6e2D0WuhyAdagA8pFKd+A4j/25322gAXfWBpPfY=; b=OkR5D5LLAV/z/Pa8EbYL/b/u+HOCWV1tL1bhCwahCLb2RdXi7I+pZjLYvKnjZIYO9/ PuxiimBpG+yn2kvWGXrHTugfglDnblt0UxtRfsz7diTM+352u+E2dow4+EUdliZSPlOY MR9ibrp1vbipQRNKA5q4RCOkOE5wajGGNpDPf5MFxrmGMn4OQwWmxglw+ACzdH/ZK5f+ ZD85oTKIgLFUSqFqRNtj5r8Y+02kB3JeNJl3zrojHZoq+hz450aqrSrcThWQVsbNd3a4 e9TWGAU8+98Tm3ea4yWPgHEkrldxI7VD3qR3mXarik7PxfJhN2i2aa6YTKnA2FyzCcrw CJzA== X-Gm-Message-State: AJIora9yDpweIFgwp1/WA+e7pbWvjWfSt0qEB6B7Ks72Np/OPVuXNG2l CYto19hTG/G0OXG/LWpSl6k= X-Google-Smtp-Source: AGRyM1teManzHf02k9BnN7RWm8XaPFbq5SB+pzYaKKPLVc/Knc5lPeI/L5RYjZzWMcht9oL3XKSt1Q== X-Received: by 2002:a17:90b:33c8:b0:1ea:c199:9794 with SMTP id lk8-20020a17090b33c800b001eac1999794mr12036766pjb.224.1655490357822; Fri, 17 Jun 2022 11:25:57 -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 d20-20020a056a00199400b0050dc762815asm4263737pfl.52.2022.06.17.11.25.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Jun 2022 11:25:57 -0700 (PDT) In-Reply-To: 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:234717 Archived-At: On 6/17/2022 10:17 AM, Jim Porter wrote: > On 6/17/2022 4:59 AM, Lars Ingebrigtsen wrote: >> Andreas Schwab writes: >> >>> See bug#44824. >> >> Ah, right.  The fix proposed there was: >> >>      org.el: Avoid xdg-open silent failure >>      * lisp/org.el (org-open-file): Use 'pipe :connection-type instead of >>      'pty to prevent killing of background process on handler exit. >> >> Perhaps Jim has some comments here; added to the CCs. > > Yeah, this is an issue with how `start-file-process' is being called in > Eshell (see `eshell-gather-process-output'). If I call `(setq > process-connection-type nil)' before running gio in Eshell, it works fine. Oh right... I remember looking at a related issue before. Note: I don't think this will directly fix the issue in this bug, but it might affect how we do fix this, so I'm mentioning it here. `eshell-needs-pipe-p' has a link to bug#1388, which discusses why that function exists in the first place. Basically, if `eshell-needs-pipe-p' didn't exist, then the following Eshell command wouldn't work right[1]: ~ $ *echo "1+1" | bc However, the solution isn't quite right if you think about it: while it's true that bc's stdin should be a pipe, couldn't its stdout still be a pty? The all-or-nothing nature of "pipe vs pty" seems a bit over-restrictive. For example, this is (part of) why piping to `less' is so broken in Eshell. If you remove "less" from `eshell-visual-commands', you can see some of the issues. The following works ok, though you get the "dumb terminal" interface for less: ~ $ less file.txt But this fails: ~ $ cat file.txt | less Missing filename ("less --help" for help) I believe that's because `less' sees that stdin is a pty in that case and so it expects a filename. However, adding `less' to `eshell-needs-pipe' fails though because then `less' thinks stdout is a pipe too, so you don't even get the dumb terminal UI; it just forwards stdin to stdout unchanged. Fixing this would get rid of the current uses for `eshell-needs-pipe-p', but then we'd probably want to keep it around in a slightly different form in order to handle gio/xdg-open properly. What we do about the issue described above would probably determine how the contents of `eshell-needs-pipe' should be specified. [1] The "*" in that command is to use the real /bin/echo, since bc expects a trailing newline and Eshell's built-in echo doesn't do that.