From cfe4aaf59c74449da911164b0ca498c6120d354d Mon Sep 17 00:00:00 2001 From: Ken Manheimer Date: Sat, 16 Jan 2016 16:31:32 -0500 Subject: [PATCH] multishell - provide cue when connecting via cd --- multishell.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/multishell.el b/multishell.el index a7b1d3b5e..1f589099f 100644 --- a/multishell.el +++ b/multishell.el @@ -449,11 +449,13 @@ Return them as a list (name dir), with dir nil if none given." "/bin/sh")) (name (file-name-nondirectory prog)) (startfile (concat "~/.emacs_" name)) - (xargs-name (intern-soft (concat "explicit-" name "-args")))) + (xargs-name (intern-soft (concat "explicit-" name "-args"))) + is-remote) (set-buffer buffer-name) (if (and path (not (string= path ""))) (setq default-directory path)) - (when (and (file-remote-p default-directory) + (setq is-remote (file-remote-p default-directory)) + (when (and is-remote (derived-mode-p 'shell-mode) (not (comint-check-proc (current-buffer)))) ;; We're returning to an already established but disconnected remote @@ -461,7 +463,9 @@ Return them as a list (name dir), with dir nil if none given." (tramp-cleanup-connection (tramp-dissect-file-name default-directory 'noexpand) 'keep-debug 'keep-password)) - ;; (cd default-directory) will reconnect a disconnected remote: + ;; (cd default-directory) will connect if remote: + (when is-remote + (message "Connecting to %s" default-directory)) (cd default-directory) (setq buffer (set-buffer (apply 'make-comint (multishell-unbracket-asterisks buffer-name) -- 2.39.2