From: Juri Linkov Date: Wed, 4 Apr 2018 20:43:54 +0000 (+0300) Subject: * lisp/shell.el (shell-mode): Check if buffer has a live process. X-Git-Tag: emacs-27.0.90~5326 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=25b22772a7149a5207e4693f149718329a25e135;p=emacs.git * lisp/shell.el (shell-mode): Check if buffer has a live process. (Bug#31028) --- diff --git a/lisp/shell.el b/lisp/shell.el index 5c228a5eba9..d4a0556ceb3 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -568,8 +568,10 @@ buffer." (setq list-buffers-directory (expand-file-name default-directory)) ;; shell-dependent assignments. (when (ring-empty-p comint-input-ring) - (let ((shell (file-name-nondirectory (car - (process-command (get-buffer-process (current-buffer)))))) + (let ((shell (if (get-buffer-process (current-buffer)) + (file-name-nondirectory + (car (process-command (get-buffer-process (current-buffer))))) + "")) (hsize (getenv "HISTSIZE"))) (and (stringp hsize) (integerp (setq hsize (string-to-number hsize)))