From: Jim Porter Date: Wed, 21 Dec 2022 00:20:50 +0000 (-0800) Subject: When redirecting in Eshell, check for "/dev/null" specifically X-Git-Tag: emacs-29.0.90~1049 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d6c8d5dbc9fc4786e91b76654058e904c96f0e11;p=emacs.git 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. --- 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))))