From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jeff Kowalski Newsgroups: gmane.emacs.bugs Subject: bug#56013: 28.1; "gio open" and "xdg-open" fail silently under eshell Date: Tue, 22 Nov 2022 13:00:32 -0800 Message-ID: References: <87h74kes5l.fsf@gnus.org> <87czf88yre.fsf@igel.home> <87ilozbivd.fsf@gnus.org> <292942b6-4a7f-0002-2af4-210b32612ba1@gmail.com> <381f9df9-4442-4580-17f5-6590f7326e3b@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000001b77e705ee1577cb" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30304"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Andreas Schwab , Lars Ingebrigtsen , 56013@debbugs.gnu.org To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 23 09:29:58 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 1oxl8n-0007ki-Ii for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 23 Nov 2022 09:29:57 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oxl85-0000aY-85; Wed, 23 Nov 2022 03:29:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oxl81-0000ZE-8a for bug-gnu-emacs@gnu.org; Wed, 23 Nov 2022 03:29:10 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oxl7w-0001MJ-Jv for bug-gnu-emacs@gnu.org; Wed, 23 Nov 2022 03:29:07 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oxl7w-0007TC-En for bug-gnu-emacs@gnu.org; Wed, 23 Nov 2022 03:29:04 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jeff Kowalski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 Nov 2022 08:29:04 +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.166919210928601 (code B ref 56013); Wed, 23 Nov 2022 08:29:04 +0000 Original-Received: (at 56013) by debbugs.gnu.org; 23 Nov 2022 08:28:29 +0000 Original-Received: from localhost ([127.0.0.1]:53439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxl7M-0007RC-Tn for submit@debbugs.gnu.org; Wed, 23 Nov 2022 03:28:29 -0500 Original-Received: from mail-vs1-f48.google.com ([209.85.217.48]:39514) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxaNt-0004dx-DY for 56013@debbugs.gnu.org; Tue, 22 Nov 2022 16:00:50 -0500 Original-Received: by mail-vs1-f48.google.com with SMTP id m4so15676547vsc.6 for <56013@debbugs.gnu.org>; Tue, 22 Nov 2022 13:00:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=O+SjeY6eKHleQgOAt5/4wAgk/6dY6y/JOVAHW1PaxwY=; b=SlZZgsvbTyo3PwKAQ8TxiareWOUcaShmOUirIfdwjEqu4DEXZQUIhE/+ffa6UR73UK 7dXu3ZMZnjuXAQ06UtOhAgf6epH4mP1X3RebDUHROYXstV0VimA4xLSWhvFRQV9/i1WS FAfgsS7pz3ZmrssJGhN9rB3er74llk8Vqulh+lX/ix87pvdD5L8Sxj4jf6WvvWkYN2si jpVebjHAZxFBuIX5xqfJnDVJ0+j/znS/ihbVzmohxzO3Y5FB6OlwmLryH/BZWtC1Lbes 5+lyU3yn6B99xuJcegugdaLuDjDCVpomCLvoq9rju/HVXGDGcRtvVW7GaiedpdWxEb5a r+Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=O+SjeY6eKHleQgOAt5/4wAgk/6dY6y/JOVAHW1PaxwY=; b=m3GC6uO8wC91xTOmI1x3J2KSWD45THPgvw0HCShZVWtrq25ROXv/QPW9c1uIPUFOXV vIdq78kfY9s4HZFdH1dv768fIqm3XicfsCtb7FLCzsPgbJHAwgKYyAzFq+jWlsyZgvmw xXHIRRYctbUDhwaD42GPf9l6hcbvn+zB2mwpBcSR4pS+T5MAFdRpGQSsuDdAncQDRKxK EehBaHYFiJpIDR3gph7HNUkUbrwFGaPiwC2VI42gOahTTUyydRlY4SvXMMxtkmHSfC86 Lo6qN4/EnQYhEVS3QKIJ/Iyy4r7qcKEh1MPH7LSr10zIwGt3jRBofzo3ARMH+BwCfLJH fyDg== X-Gm-Message-State: ANoB5pkhQ0TBHOaKwbSqEo7mIHpSXJIXFdCsH6aBvdyf0wldlZo3dKgx /ehotjJJtT6yft4O47oPjJ6/YrDynQfeqiFetXM= X-Google-Smtp-Source: AA0mqf56d8O2S5eKeKooMwFfF+M5sVcv0QMk2iNG7e+Xe7yKuJndLv28VQG8hgMY81q0yYDRfVn4vpXO/5kqxmhzGSs= X-Received: by 2002:a67:fd53:0:b0:3a6:eff1:94ca with SMTP id g19-20020a67fd53000000b003a6eff194camr3849563vsr.62.1669150843564; Tue, 22 Nov 2022 13:00:43 -0800 (PST) In-Reply-To: <381f9df9-4442-4580-17f5-6590f7326e3b@gmail.com> X-Mailman-Approved-At: Wed, 23 Nov 2022 03:28:22 -0500 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:248718 Archived-At: --0000000000001b77e705ee1577cb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks for the response and suggestion. >From eshell, =CE=BB xdg-open file.txt exits immediately, without opening file.txt, and =CE=BB cat | xdg-open file.txt | cat shows the same behavior, but =CE=BB setsid -w xdg-open file.txt opens the file as expected. Hope this helps, Jeff On Tue, Nov 22, 2022 at 12:20 PM Jim Porter wrote: > On 11/20/2022 9:14 PM, Jeff Kowalski wrote: > > While I cannot help to craft the solution (I'm limited by my knowledge > > of internals here), I'm very happy to help test proposals. It seemed > > there was a hint of a solution developed in this thread. > > This is a hacky workaround, but if it works for you, it would help prove > a strategy to fix this: > > ~ $ cat | xdg-open file.txt | cat > > The above forces 'xdg-open' to be run with pipes for its stdin and > stdout. I believe the issue is that when 'xdg-open' sees a PTY for > stdin/stdout, it seems to assume that the PTY will live for a long time; > however, in Eshell, it will close the PTY as soon as 'xdg-open' returns, > which breaks things. > > A real fix would be to tell Eshell that certain programs, like xdg-open, > should never use PTYs. (There used to be a variable called > 'eshell-needs-pipe' that did something similar to this, but after > changing how Eshell connects processes, it was no longer needed.) > --0000000000001b77e705ee1577cb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks for the response and suggestion.
From eshell,= =C2=A0
=C2=A0 =C2=A0 =C2=A0=CE=BB xdg-open file.txt=C2=A0=C2=A0
exits immediately, without opening file.txt, and
=C2= =A0 =C2=A0 =C2=A0=CE=BB cat | xdg-open file.txt | cat
shows t= he same behavior, but
=C2=A0 =C2=A0 =C2=A0=CE=BB setsid -w xdg-op= en file.txt
opens the file as expected.
Hope this= =C2=A0helps,
Jeff



On Tue, Nov = 22, 2022 at 12:20 PM Jim Porter <jporterbugs@gmail.com> wrote:
On 11/20/2022 9:14 PM, Jeff Kowalski wrote:
> While I cannot help to craft the solution (I'm limited by my knowl= edge
> of internals here), I'm very happy to help test proposals.=C2=A0 I= t seemed
> there was a hint of a solution developed in this thread.

This is a hacky workaround, but if it works for you, it would help prove a strategy to fix this:

=C2=A0 =C2=A0~ $ cat | xdg-open file.txt | cat

The above forces 'xdg-open' to be run with pipes for its stdin and =
stdout. I believe the issue is that when 'xdg-open' sees a PTY for =
stdin/stdout, it seems to assume that the PTY will live for a long time; however, in Eshell, it will close the PTY as soon as 'xdg-open' ret= urns,
which breaks things.

A real fix would be to tell Eshell that certain programs, like xdg-open, should never use PTYs. (There used to be a variable called
'eshell-needs-pipe' that did something similar to this, but after <= br> changing how Eshell connects processes, it was no longer needed.)
--0000000000001b77e705ee1577cb--