Subject: bug#56013: 28.1; "gio open" and "xdg-open" fail silently under eshell

From: Jim Porter <[email-masked]>
Date: Tue, 22 Nov 2022 12:19:56 -0800

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.)