From b04f42cca272b9a0f3b5e3167ce956523b161a7e Mon Sep 17 00:00:00 2001 From: Jim Porter Date: Tue, 20 Dec 2022 16:20:50 -0800 Subject: [PATCH] When redirecting to the null device in Eshell, use "/dev/null" This is so that users can type "cmd ... > /dev/null" in Eshell no matter what their system's null device is called. This partially reverts 67a8bdb90c9b5865b7f17290c7135b1a5458c36d. Do not merge to master. * lisp/eshell/esh-io.el (eshell-set-output-handle): Use "/dev/null" literally. --- lisp/eshell/esh-io.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/eshell/esh-io.el b/lisp/eshell/esh-io.el index 4620565f857..6df40914060 100644 --- a/lisp/eshell/esh-io.el +++ b/lisp/eshell/esh-io.el @@ -342,7 +342,9 @@ eshell-set-output-handle (when target (let ((handles (or handles eshell-current-handles))) (if (and (stringp target) - (string= target (null-device))) + ;; This should be the literal string "/dev/null", not + ;; `null-device'. + (string= target "/dev/null")) (aset handles index nil) (let ((where (eshell-get-target target mode)) (current (car (aref handles index)))) -- 2.25.1