From 2abbf3551d890968d1bc2a198ddfff46ffee76e5 Mon Sep 17 00:00:00 2001 From: Jim Porter Date: Sat, 11 Jan 2025 11:50:19 -0800 Subject: [PATCH] Make Eshell's "ls" command return a non-zero status on errors * lisp/eshell/em-ls.el (eshell/ls): Set exit code when calling 'error-func'. (cherry picked from commit aff9261ab2ab3cf3435cf006e600a575bc2e3d6b) --- lisp/eshell/em-ls.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/eshell/em-ls.el b/lisp/eshell/em-ls.el index ce2e6ab7d60..52a330a3353 100644 --- a/lisp/eshell/em-ls.el +++ b/lisp/eshell/em-ls.el @@ -329,7 +329,7 @@ instead." "An alias version of `eshell-do-ls'." (eshell-with-buffered-print (let ((insert-func #'eshell-buffered-print) - (error-func #'eshell-error)) + (error-func (lambda (s) (eshell-error s) (eshell-set-exit-info 2)))) (apply 'eshell-do-ls args)))) (put 'eshell/ls 'eshell-no-numeric-conversions t) -- 2.39.5