GNU bug report logs - #79079
31.0.50; Piped command output is sometimes lost in Eshell

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Wed, 23 Jul 2025 09:57:01 UTC

Severity: normal

Found in version 31.0.50

Full log


Message #80 received at 79079 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>, Jim Porter <jporterbugs <at> gmail.com>
Cc: mail <at> daniel-mendler.de, 79079 <at> debbugs.gnu.org
Subject: Re: bug#79079: 31.0.50; Piped command output is sometimes lost in
 Eshell
Date: Sun, 27 Jul 2025 08:06:10 -0700
On 2025-07-26 21:30, 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.

EPIPE typically means exit, yes, as the process reports the error and 
often has nothing better to do than to exit. However, it doesn't always 
mean exit. For example, an interactive Emacs does not exit with it gets 
EPIPE, as can be demonstrated with this shell command on GNU/Linux:

strace -o /tmp/tr emacs -Q -eval \
  "(princ (make-string 10000 ?a) 'external-debugging-output)" 2>&1|:

and then type C-x C-c to exit Emacs.

In this case Emacs painstakingly outputs 10000 'a' bytes, one at a time, 
and ignores each of the 10000 EPIPE errors that it gets.


Not sure I know what you mean by "doing what a Posix shell does". Are 
you talking about commands that a shell implements directly, like the 
shell 'echo' command typically is? If so, those commands are supposed to 
do what their standalone counterpart executables do, which typically 
means they die due to getting a SIGPIPE signal.




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.