aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/shell.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/shell.el')
-rw-r--r--lisp/shell.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/lisp/shell.el b/lisp/shell.el
index bceea990baf..dde81c6cb95 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -583,6 +583,21 @@ Otherwise, one argument `-i' is passed to the shell.
583 (get-buffer-create (or buffer "*shell*")) 583 (get-buffer-create (or buffer "*shell*"))
584 ;; If the current buffer is a dead shell buffer, use it. 584 ;; If the current buffer is a dead shell buffer, use it.
585 (current-buffer))) 585 (current-buffer)))
586
587 ;; On remote hosts, the local `shell-file-name' might be useless.
588 (if (and (interactive-p)
589 (file-remote-p default-directory)
590 (null explicit-shell-file-name)
591 (null (getenv "ESHELL")))
592 (with-current-buffer buffer
593 (set (make-local-variable 'explicit-shell-file-name)
594 (file-remote-p
595 (expand-file-name
596 (read-file-name
597 "Remote shell path: " default-directory shell-file-name
598 t shell-file-name))
599 'localname))))
600
586 ;; Pop to buffer, so that the buffer's window will be correctly set 601 ;; Pop to buffer, so that the buffer's window will be correctly set
587 ;; when we call comint (so that comint sets the COLUMNS env var properly). 602 ;; when we call comint (so that comint sets the COLUMNS env var properly).
588 (pop-to-buffer buffer) 603 (pop-to-buffer buffer)