]> git.eshelyaron.com Git - emacs.git/commit
Fix handling of output handles in nested Eshell forms
authorJim Porter <jporterbugs@gmail.com>
Tue, 20 Dec 2022 17:39:07 +0000 (09:39 -0800)
committerJim Porter <jporterbugs@gmail.com>
Thu, 22 Dec 2022 19:35:12 +0000 (11:35 -0800)
commit6defbd65b664b17ad7389a936743debe23d5257e
tree0e4a3aad9e5cc5601376dc523fb696b0b4667de0
parent54087e84df872c9aa30866b880e8ac0b917cbd94
Fix handling of output handles in nested Eshell forms

Previously, the output handles in nested forms would be reset to the
default, leading to wrong behavior for commands like

  {echo a; echo b} > file

"b" would be written to "file" as expected, but "a" would go to
standard output (bug#59545).

* lisp/eshell/esh-cmd.el (eshell-parse-command): Use
'eshell-with-copied-handles' for each statement within the whole
Eshell command.

* test/lisp/eshell/esh-io-tests.el (esh-io-test/redirect-subcommands)
(esh-io-test/redirect-subcommands/override)
(esh-io-test/redirect-subcommands/interpolated): New tests.

* test/lisp/eshell/em-script-tests.el
(em-script-test/source-script/redirect)
(em-script-test/source-script/redirect/dev-null): New tests.
(em-script-test/source-script, em-script-test/source-script/arg-vars)
(em-script-test/source-script/all-args-var): Tweak names/docstrings.

* test/lisp/eshell/em-extpipe-tests.el (em-extpipe-tests--deftest):
Skip over the newly-added 'eshell-with-copied-handles' form when
checking the parse results.

* test/lisp/eshell/em-tramp-tests.el (em-tramp-test/su-default)
(em-tramp-test/su-user, em-tramp-test/su-login)
(em-tramp-test/sudo-shell, em-tramp-test/sudo-user-shell)
(em-tramp-test/doas-shell, em-tramp-test/doas-user-shell): Update
expected command forms.
doc/misc/eshell.texi
lisp/eshell/esh-cmd.el
test/lisp/eshell/em-extpipe-tests.el
test/lisp/eshell/em-script-tests.el
test/lisp/eshell/em-tramp-tests.el
test/lisp/eshell/esh-io-tests.el