summaryrefslogtreecommitdiff
path: root/lisp/eshell/esh-io.el
diff options
context:
space:
mode:
authorJim Porter <jporterbugs@gmail.com>2022-12-20 16:20:50 -0800
committerJim Porter <jporterbugs@gmail.com>2022-12-21 17:14:41 -0800
commitd6c8d5dbc9fc4786e91b76654058e904c96f0e11 (patch)
tree775ce8db53458f32fdb6978554fb3e6f9b2adbf1 /lisp/eshell/esh-io.el
parente59216d3be86918b995bd63273c851ebc6176a83 (diff)
downloademacs-d6c8d5dbc9fc4786e91b76654058e904c96f0e11.tar.gz
When redirecting in Eshell, check for "/dev/null" specifically
This is so that users can type "cmd ... > /dev/null" in Eshell no matter what their system's null device is called. (Users can still use their system's null device name when redirecting, too. Eshell doesn't need to do anything special to support that.) This partially reverts 67a8bdb90c9b5865b7f17290c7135b1a5458c36d. See bug#59545. Do not merge to master. * lisp/eshell/esh-io.el (eshell-set-output-handle): Use "/dev/null" literally.
Diffstat (limited to 'lisp/eshell/esh-io.el')
-rw-r--r--lisp/eshell/esh-io.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/eshell/esh-io.el b/lisp/eshell/esh-io.el
index 4620565f857..d223be680f9 100644
--- a/lisp/eshell/esh-io.el
+++ b/lisp/eshell/esh-io.el
@@ -342,7 +342,11 @@ If HANDLES is nil, use `eshell-current-handles'."
(when target
(let ((handles (or handles eshell-current-handles)))
(if (and (stringp target)
- (string= target (null-device)))
+ ;; The literal string "/dev/null" is intentional here.
+ ;; It just provides compatibility so that users can
+ ;; redirect to "/dev/null" no matter the actual value
+ ;; of `null-device'.
+ (string= target "/dev/null"))
(aset handles index nil)
(let ((where (eshell-get-target target mode))
(current (car (aref handles index))))