summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Pykhalov <go.wigust@gmail.com>2019-05-13 02:45:00 +0300
committerOleg Pykhalov <go.wigust@gmail.com>2019-05-13 02:45:00 +0300
commitca1132ae5ea76de9e7122d61eb96f3a95fcce04f (patch)
tree386def07d1dd726485dd7dab309b0fae4421b156
parentterminal-here.el: Implement ssh sudo. (diff)
downloademacs-terminal-here-wip.tar.gz
terminal-here.el: Implement cd to directory after sudo.wip
* terminal-here.el (terminal-here-launch): Implement cd to directory after sudo.
-rw-r--r--terminal-here.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/terminal-here.el b/terminal-here.el
index 15c924d..3d1252c 100644
--- a/terminal-here.el
+++ b/terminal-here.el
@@ -240,7 +240,10 @@ changed it by running `cd'."
(when multiplexer (terminal-here-not-null-symbol terminal-here-multiplexer))
(if (and (string-prefix-p "/ssh:" directory)
(s-contains? "|" directory))
- (let ((ssh+sudo (split-string directory "|")))
+ (let* ((ssh+sudo (split-string directory "|"))
+ (user (car (split-string (nth 1 (split-string (cadr ssh+sudo) ":"))
+ "@")))
+ (directory (nth 2 (split-string (cadr ssh+sudo) ":"))))
(terminal-here-launch-in-directory
(mapconcat 'identity (list "/ssh:"
(cadr (split-string (car ssh+sudo) ":"))
@@ -248,8 +251,7 @@ changed it by running `cd'."
"")
multiplexer)
(start-process "xdotool" nil (expand-file-name "~/bin/sudo-to-user-web")
- (car (split-string (nth 1 (split-string (cadr ssh+sudo) ":"))
- "@"))))
+ user directory))
(terminal-here-launch-in-directory directory multiplexer)))
;;;###autoload