]> git.eshelyaron.com Git - emacs.git/commit
Simplify handling of /dev/null redirection in Eshell
authorJim Porter <jporterbugs@gmail.com>
Tue, 20 Dec 2022 21:47:20 +0000 (13:47 -0800)
committerJim Porter <jporterbugs@gmail.com>
Thu, 22 Dec 2022 19:35:12 +0000 (11:35 -0800)
commit17bf6a829ca2fd2920c01e1aee30ab16b9c672eb
tree945f4fba5c798fd69494bbe54cf03496745755a3
parent6defbd65b664b17ad7389a936743debe23d5257e
Simplify handling of /dev/null redirection in Eshell

This also fixes an issue where "echo hi > foo > /dev/null" didn't
write to the file "foo".  (Note that users can still use their
system's null device name when redirecting; Eshell doesn't need to do
anything special to support that.)

* lisp/eshell/esh-io.el (eshell-virtual-targets): Add "/dev/null".
(eshell-set-output-handle): Handle 'eshell-null-device'.

* test/lisp/eshell/esh-io-tests.el
(esh-io-test/redirect-subcommands/dev-null)
(esh-io-test/virtual/dev-null, esh-io-test/virtual/dev-null/multiple):
New tests.
lisp/eshell/esh-io.el
test/lisp/eshell/esh-io-tests.el