]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/shell.el (shell-mode): Check if buffer has a live process.
authorJuri Linkov <juri@linkov.net>
Wed, 4 Apr 2018 20:43:54 +0000 (23:43 +0300)
committerJuri Linkov <juri@linkov.net>
Wed, 4 Apr 2018 20:43:54 +0000 (23:43 +0300)
(Bug#31028)

lisp/shell.el

index 5c228a5eba9a4516f35f4623d50a0b6a3ad0f1c5..d4a0556ceb3bddcb7eddd9a6b1283b437b9592d1 100644 (file)
@@ -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)))