aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/shell.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/shell.el')
-rw-r--r--lisp/shell.el22
1 files changed, 21 insertions, 1 deletions
diff --git a/lisp/shell.el b/lisp/shell.el
index 2f11cc6314c..dde81c6cb95 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -459,7 +459,12 @@ buffer."
459 ;; shell-dependent assignments. 459 ;; shell-dependent assignments.
460 (when (ring-empty-p comint-input-ring) 460 (when (ring-empty-p comint-input-ring)
461 (let ((shell (file-name-nondirectory (car 461 (let ((shell (file-name-nondirectory (car
462 (process-command (get-buffer-process (current-buffer))))))) 462 (process-command (get-buffer-process (current-buffer))))))
463 (hsize (getenv "HISTSIZE")))
464 (and (stringp hsize)
465 (integerp (setq hsize (string-to-number hsize)))
466 (> hsize 0)
467 (set (make-local-variable 'comint-input-ring-size) hsize))
463 (setq comint-input-ring-file-name 468 (setq comint-input-ring-file-name
464 (or (getenv "HISTFILE") 469 (or (getenv "HISTFILE")
465 (cond ((string-equal shell "bash") "~/.bash_history") 470 (cond ((string-equal shell "bash") "~/.bash_history")
@@ -578,6 +583,21 @@ Otherwise, one argument `-i' is passed to the shell.
578 (get-buffer-create (or buffer "*shell*")) 583 (get-buffer-create (or buffer "*shell*"))
579 ;; If the current buffer is a dead shell buffer, use it. 584 ;; If the current buffer is a dead shell buffer, use it.
580 (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
581 ;; 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
582 ;; 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).
583 (pop-to-buffer buffer) 603 (pop-to-buffer buffer)