diff --git a/lisp/shell.el b/lisp/shell.el index e6b315ee5c0..d485c8af567 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -718,7 +718,10 @@ shell-mode ;; This is not really correct, since the shell buffer does not really ;; edit this directory. But it is useful in the buffer list and menus. - (setq list-buffers-directory (expand-file-name default-directory)) + (setq list-buffers-directory (expand-file-name default-directory))) + +(defun shell-setup-input-ring () + "Set up `comint-input-ring' for this buffer, for the chosen shell." ;; shell-dependent assignments. (when (ring-empty-p comint-input-ring) (let ((remote (file-remote-p default-directory)) @@ -948,6 +951,7 @@ shell (symbol-value xargs-name) '("-i"))) (shell-mode) + (shell-setup-input-ring) (when (file-exists-p startfile) ;; Wait until the prompt has appeared. (while (= start-point (point))