1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-26 07:11:34 -08:00
emacs/lisp/eshell
Jim Porter 3a388ab4a6 When executing an Eshell pipeline, send input to the first process
Previously, input was sent to the last process in the pipeline,
resulting in unexpected behavior when running commands like
'tr a-z A-Z | rev'.

* lisp/eshell/esh-util.el (eshell-process-pair-p)
(eshell-make-process-pair): New functions.

* lisp/eshell/esh-cmd.el (eshell-last-async-proc): Rename to...
(eshell-last-async-procs): ... this, and store a pair of processes.
(eshell-interactive-process): Replace with...
(eshell-interactive-process-p, eshell-head-process)
(eshell-tail-process): ... these.
(eshell-cmd-initialize): Set 'eshell-last-async-procs'.
(eshell-do-pipelines): Set 'headproc'.
(eshell-execute-pipeline): Return 'headproc' and 'tailproc'.
(eshell-resume-eval): Use 'eshell-last-async-procs'.
(eshell-do-eval): Make sure we work with a pair of processes.

* lisp/eshell/esh-proc.el (eshell-send-eof-to-process): Move from
here...
* lisp/eshell/esh-mode.el (eshell-send-eof-to-process): ... to here,
and only send EOF to the head process.

* lisp/eshell/em-cmpl.el (eshell-complete-parse-arguments)
* lisp/eshell/esh-mode.el (eshell-intercept-commands)
(eshell-watch-for-password-prompt):
Use 'eshell-interactive-process-p'.

* lisp/eshell/em-rebind.el (eshell-delchar-or-maybe-eof)
* lisp/eshell/em-term.el (eshell-term-send-raw-string)
* lisp/eshell/esh-mode.el (eshell-self-insert-command)
(eshell-send-input, eshell-send-invisible):
Use 'eshell-head-process'.

* lisp/eshell/esh-cmd.el (eshell-as-subcommand):
Use 'eshell-tail-process'.

* lisp/eshell/eshell.el (eshell-command):
* test/lisp/eshell/eshell-tests-helpers.el
(eshell-wait-for-subprocess):
Use 'eshell-interactive-process-p' and 'eshell-tail-process'.

* test/lisp/eshell/eshell-tests.el (eshell-test/pipe-headproc-stdin):
New test.
2022-02-03 20:02:22 +01:00
..
em-alias.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
em-banner.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
em-basic.el Raise an error from 'eval-eval-using-options' for unknown options 2022-01-21 13:06:11 +01:00
em-cmpl.el When executing an Eshell pipeline, send input to the first process 2022-02-03 20:02:22 +01:00
em-dirs.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
em-extpipe.el Fix input of sharp-quoted symbols in Eshell with em-extpipe 2022-01-26 14:16:40 +01:00
em-glob.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
em-hist.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
em-ls.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
em-pred.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
em-prompt.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
em-rebind.el When executing an Eshell pipeline, send input to the first process 2022-02-03 20:02:22 +01:00
em-script.el Don't use 'eshell-eval-using-options' for 'eshell/source' or 'eshell/.' 2022-01-21 13:06:34 +01:00
em-smart.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
em-term.el When executing an Eshell pipeline, send input to the first process 2022-02-03 20:02:22 +01:00
em-tramp.el Treat "-" as a positional arg in 'eshell-eval-using-options' 2022-01-25 13:28:48 +01:00
em-unix.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
em-xtra.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
esh-arg.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
esh-cmd.el When executing an Eshell pipeline, send input to the first process 2022-02-03 20:02:22 +01:00
esh-ext.el ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
esh-io.el When executing an Eshell pipeline, send input to the first process 2022-02-03 20:02:22 +01:00
esh-mode.el When executing an Eshell pipeline, send input to the first process 2022-02-03 20:02:22 +01:00
esh-module.el Add Eshell syntax to more easily bypass Eshell's own pipelining 2022-01-24 21:46:31 +01:00
esh-opt.el Treat "-" as a positional arg in 'eshell-eval-using-options' 2022-01-25 13:28:48 +01:00
esh-proc.el When executing an Eshell pipeline, send input to the first process 2022-02-03 20:02:22 +01:00
esh-util.el When executing an Eshell pipeline, send input to the first process 2022-02-03 20:02:22 +01:00
esh-var.el Merge from origin/emacs-28 2022-01-01 07:03:03 -05:00
eshell.el When executing an Eshell pipeline, send input to the first process 2022-02-03 20:02:22 +01:00