diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index ea2ccb08be1..e6f3cb5f6ad 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -952,7 +952,7 @@ buffer's process if STRING contains a password prompt defined by `eshell-password-prompt-regexp'. This function could be in the list `eshell-output-filter-functions'." - (when eshell-foreground-command + (when (eshell-head-process) (save-excursion (let ((case-fold-search t)) (goto-char eshell-last-output-block-begin)