diff options
author | Juri Linkov <juri@linkov.net> | 2018-04-04 23:43:54 +0300 |
---|---|---|
committer | Juri Linkov <juri@linkov.net> | 2018-04-04 23:43:54 +0300 |
commit | 25b22772a7149a5207e4693f149718329a25e135 (patch) | |
tree | 8d53d9fc4628f9a9b1047784f9c9e300559a425e /lisp/shell.el | |
parent | 29006a6fd8e989013098b0281aa0b9efe13feb1d (diff) | |
download | emacs-25b22772a7149a5207e4693f149718329a25e135.tar.gz |
* lisp/shell.el (shell-mode): Check if buffer has a live process.
(Bug#31028)
Diffstat (limited to 'lisp/shell.el')
-rw-r--r-- | lisp/shell.el | 6 |
1 files changed, 4 insertions, 2 deletions
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))) |