Make `shell-mode' more robust

* lisp/shell.el (shell-mode): Ensure that
`comint-input-ring-file-name' is non-nil when calling `file-truename'.
This commit is contained in:
Michael Albinus 2024-06-28 11:28:33 +02:00
parent c4ec905c9a
commit c4ad54812a

View file

@ -764,9 +764,10 @@ command."
(setq-local comint-input-ring-size hsize)) (setq-local comint-input-ring-size hsize))
(setq comint-input-ring-file-name (setq comint-input-ring-file-name
(concat remote hfile))) (concat remote hfile)))
(if (or (equal comint-input-ring-file-name "") (if (and comint-input-ring-file-name
(equal (file-truename comint-input-ring-file-name) (or (equal comint-input-ring-file-name "")
(file-truename null-device))) (equal (file-truename comint-input-ring-file-name)
(file-truename null-device))))
(setq comint-input-ring-file-name nil)) (setq comint-input-ring-file-name nil))
;; Arrange to write out the input ring on exit, if the shell doesn't ;; Arrange to write out the input ring on exit, if the shell doesn't
;; do this itself. ;; do this itself.