diff options
author | Vincent Ambo <tazjin@tvl.su> | 2023-08-25T15·29+0300 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2023-08-25T15·34+0000 |
commit | 6d5d96ecea46b6daeccfd7814ea3565e05068bdb (patch) | |
tree | a50c2a40929f1b9e3141ce123aef89ca8bd543e4 /tools/emacs-pkgs | |
parent | a3dbb60213fad39f73f6a03fb5e14eaa09b85670 (diff) |
fix(emacs-pkgs/term-switcher): apply tramp workaround to first vterm r/6524
Change-Id: Idc01001856cb01104c20b62dc4221c0ad2ab7a3f Reviewed-on: https://cl.tvl.fyi/c/depot/+/9153 Tested-by: BuildkiteCI Autosubmit: tazjin <tazjin@tvl.su> Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tools/emacs-pkgs')
-rw-r--r-- | tools/emacs-pkgs/term-switcher/term-switcher.el | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/tools/emacs-pkgs/term-switcher/term-switcher.el b/tools/emacs-pkgs/term-switcher/term-switcher.el index 76c756f73c98..c141a5e9cc08 100644 --- a/tools/emacs-pkgs/term-switcher/term-switcher.el +++ b/tools/emacs-pkgs/term-switcher/term-switcher.el @@ -27,15 +27,18 @@ :type '(string) :group 'term-switcher) +(defun ts/create-vterm () + "Launch vterm, but don't open semi-broken vterms over TRAMP." + (if (file-remote-p default-directory) + (let ((default-directory "~")) + (vterm)) + (vterm))) + (defun ts/open-or-create-vterm (buffer) "Switch to the terminal in BUFFER, or create a new one if buffer is nil." (if buffer (switch-to-buffer buffer) - ;; Don't open semi-broken vterms over tramp. - (if (file-remote-p default-directory) - (let ((default-directory "~")) - (vterm)) - (vterm)))) + (ts/create-vterm))) (defun ts/is-vterm-buffer (buffer) "Determine whether BUFFER runs a vterm." @@ -55,6 +58,6 @@ :require-match t :action (lambda (match) (ts/open-or-create-vterm (cdr (assoc match terms))))) - (vterm)))) + (ts/create-vterm)))) (provide 'term-switcher) |