GNU bug report logs -
#79079
31.0.50; Piped command output is sometimes lost in Eshell
Previous Next
Full log
Message #89 received at 79079 <at> debbugs.gnu.org (full text, mbox):
On 7/26/2025 9:30 PM, Eli Zaretskii wrote:
> We should try doing what a Posix shell does in that case. A program
> that gets EPIPE generally exits with a failure status (right?),
> anything that happens after that is done by the shell itself.
Agreed. Eshell already does its best at the part you mention: in the
pipeline "A | B", if A writes to B and gets an EPIPE error, Eshell sends
a SIGPIPE to process A. (That's not *exactly* what happens in POSIX
shells, but because of the additional indirection Eshell has between
processes in a pipeline, it's as close as I can get without major surgery.)
The remainder is just to make sure that we follow POSIX shell behavior
as closely as we can for process B as well.
As for the rest of the discussion here, my goal isn't exactly to make
Emacs behave like a POSIX shell (which is apples-to-oranges, as Emacs
isn't a shell), but to make *Eshell* behave like a POSIX shell. That
requires some changes to process.c, but I think those changes will be
positive for Emacs in general; the result will be that Emacs responds
more carefully to EPIPE.
(Of course, if there are any changes that would help Eshell but *hurt*
Emacs's process support in other scenarios, I won't make those. But I'm
pretty sure we won't run into this problem.)
This bug report was last modified 32 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.