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'.
This commit is contained in:
Jim Porter 2025-01-11 11:50:19 -08:00
parent 3d375ced1f
commit aff9261ab2

View file

@ -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)