From ef6b7ea29f3ada533c1e7e166c6a8c5cf35703cb Mon Sep 17 00:00:00 2001 From: riscy Date: Sun, 26 Jan 2020 11:47:55 -0800 Subject: [PATCH] respawn dead shell at remote location (re: #16) --- shx.el | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/shx.el b/shx.el index db5e48a..7c3f189 100644 --- a/shx.el +++ b/shx.el @@ -178,9 +178,6 @@ In normal circumstances this input is additionally filtered by `shx-filter-input' via `comint-mode'." (interactive) (cond ((not (comint-check-proc shx-buffer)) - ;; no process? restart shell in a safe directory: - (when (file-remote-p default-directory) - (setq default-directory (getenv "HOME"))) (shx--restart-shell)) ((>= (length (shx--current-input)) shx-max-input) (message "Input line exceeds `shx-max-input'.")) @@ -402,6 +399,7 @@ If any path is absolute, prepend `comint-file-name-prefix' to it." (defun shx--restart-shell () "Guess the shell command and use `comint-exec' to restart." + (message (concat "Starting shell at " default-directory " (C-g cancels)")) (let ((cmd (shx--validate-shell-file-name))) (shx-insert 'font-lock-doc-face cmd " at " default-directory "\n") ;; manually align comint-file-name-prefix with the default-directory: