diff options
| author | Oleg Pykhalov <go.wigust@gmail.com> | 2019-05-13 02:23:09 +0300 |
|---|---|---|
| committer | Oleg Pykhalov <go.wigust@gmail.com> | 2019-05-13 02:23:09 +0300 |
| commit | a8065fba8aa55ff847f19853972fede01272c387 (patch) | |
| tree | 861bf93a6798fd38db9c9a25636fb41776a62551 | |
| parent | terminal-here: Implement directory specification. (diff) | |
| download | emacs-terminal-here-a8065fba8aa55ff847f19853972fede01272c387.tar.gz | |
* terminal-here.el (terminal-here-launch): Implement ssh sudo.
| -rw-r--r-- | terminal-here.el | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/terminal-here.el b/terminal-here.el index e504a54..b8b7526 100644 --- a/terminal-here.el +++ b/terminal-here.el @@ -237,7 +237,19 @@ changed it by running `cd'." (list (if current-prefix-arg (read-directory-name "Directory: ") default-directory))) (when multiplexer (terminal-here-not-null-symbol terminal-here-multiplexer)) - (terminal-here-launch-in-directory directory multiplexer)) + (if (and (string-prefix-p "/ssh:" directory) + (s-contains? "|" directory)) + (let ((ssh+sudo (split-string directory "|"))) + (terminal-here-launch-in-directory + (mapconcat 'identity (list "/ssh:" + (cadr (split-string (car ssh+sudo) ":")) + ":/home/sup") + "") + multiplexer) + (start-process "xdotool" nil (expand-file-name "~/bin/sudo-to-user-web") + (car (split-string (nth 1 (split-string (cadr ssh+sudo) ":")) + "@")))) + (terminal-here-launch-in-directory directory multiplexer))) ;;;###autoload (defalias 'terminal-here 'terminal-here-launch) |
