emacs/lisp/eshell
Jim Porter e381cf1fc9 Allow child processes to continue after EPIPE
This ensures that if the child process closed its stdin and Emacs tries
to write to it, the process can still do any remaining work and exit
normally.  In practice, this can occur with commands like "head(1)"
(bug#79079).

* src/fileio.c (file_for_stream): New function, extracted from...
(Fset_binary_mode): ... here.
(Ffile__close_stream): New function.

* src/process.c (send_process): When encountering EPIPE, only close the
fd for the pipe to the child process's stdin.

* lisp/eshell/esh-io.el (eshell-output-object-to-target): Don't check
for process liveness anymore.

* test/src/process-tests.el (process-tests/broken-pipe): New function.
(process-tests/broken-pipe/pipe, process-tests/broken-pipe/pty)
(process-tests/broken-pipe/pipe-stdin)
(process-tests/broken-pipe/pty-stdin): New tests.

* etc/NEWS: Announce this change.
2026-05-17 17:24:10 -07:00
..
em-alias.el Preserve the original order of Eshell aliases when loading 2026-02-21 17:13:46 -08:00
em-banner.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
em-basic.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
em-cmpl.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
em-dirs.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
em-elecslash.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
em-extpipe.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
em-glob.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
em-hist.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
em-ls.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
em-pred.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
em-prompt.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
em-rebind.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
em-script.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
em-smart.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
em-term.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
em-tramp.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
em-unix.el Autoload 'diff-no-select' 2026-02-13 19:53:12 +01:00
em-xtra.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
esh-arg.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
esh-cmd.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
esh-ext.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
esh-io.el Allow child processes to continue after EPIPE 2026-05-17 17:24:10 -07:00
esh-mode.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
esh-module.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
esh-opt.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
esh-proc.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
esh-util.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
esh-var.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
eshell.el ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00