From 2a4135b7a7d1b956ead01ed16fa18536c92bf9b4 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Fri, 28 Jun 2024 11:28:33 +0200 Subject: [PATCH] Make `shell-mode' more robust * lisp/shell.el (shell-mode): Ensure that `comint-input-ring-file-name' is non-nil when calling `file-truename'. (cherry picked from commit c4ad54812acaf8f156962047eaaaf75b0c0ecf96) --- lisp/shell.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/shell.el b/lisp/shell.el index d6f1b443ed4..89ec893a308 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -764,9 +764,10 @@ command." (setq-local comint-input-ring-size hsize)) (setq comint-input-ring-file-name (concat remote hfile))) - (if (or (equal comint-input-ring-file-name "") - (equal (file-truename comint-input-ring-file-name) - (file-truename null-device))) + (if (and comint-input-ring-file-name + (or (equal comint-input-ring-file-name "") + (equal (file-truename comint-input-ring-file-name) + (file-truename null-device)))) (setq comint-input-ring-file-name nil)) ;; Arrange to write out the input ring on exit, if the shell doesn't ;; do this itself. -- 2.39.2