From cecb9f7163345c74b5d8145174898f694724bf3f Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Mon, 19 Mar 2018 16:03:19 +0530 Subject: [PATCH] Eshell: Keep history of commands exiting with non-zero --- .emacs.d/lisp/init-eshell.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.emacs.d/lisp/init-eshell.el b/.emacs.d/lisp/init-eshell.el index fc5fd828..9059b46e 100644 --- a/.emacs.d/lisp/init-eshell.el +++ b/.emacs.d/lisp/init-eshell.el @@ -199,9 +199,13 @@ ;;; Eshell commands always return 0. (setq eshell-input-filter (lambda (str) - (not (or (/= eshell-last-command-status 0) - (string= "" str) - (string-prefix-p " " str))))) + (not (or + ;; Here we can filter out failing commands. This is usually a bad + ;; idea since a lot of useful commands have non-zero exit codes + ;; (including Emacs/Eshell functions). + ;; (/= eshell-last-command-status 0) + (string= "" str) + (string-prefix-p " " str))))) ;;; Shared history. (defvar ambrevar/eshell-history-global-ring nil