From fa8288823b546e627499dcd33281d612a6a15f3a Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 8 Aug 2023 13:48:31 +0300 Subject: [PATCH] fix(emacs-pkgs/term-switcher): don't open vterm over tramp vterm doesn't really seem to support this, but it also doesn't stop the user from doing it, resulting in weirdly broken terminals. Change-Id: I5251306a2fb72e7aae4e6c70e522bad240222301 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9017 Tested-by: BuildkiteCI Reviewed-by: tazjin Autosubmit: tazjin --- tools/emacs-pkgs/term-switcher/term-switcher.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/emacs-pkgs/term-switcher/term-switcher.el b/tools/emacs-pkgs/term-switcher/term-switcher.el index 0055f87fd..b7e4b0494 100644 --- a/tools/emacs-pkgs/term-switcher/term-switcher.el +++ b/tools/emacs-pkgs/term-switcher/term-switcher.el @@ -1,8 +1,9 @@ ;;; term-switcher.el --- Easily switch between open vterms ;; -;; Copyright (C) 2019 Google Inc. +;; Copyright (C) 2019-2020 Google Inc. +;; Copyright (C) 2021-2023 The TVL Authors ;; -;; Author: Vincent Ambo +;; Author: Vincent Ambo ;; Version: 1.1 ;; Package-Requires: (dash ivy s vterm) ;; @@ -30,7 +31,11 @@ "Switch to the buffer with BUFFER-NAME or create a new vterm buffer." (if (equal "New vterm" buffer-name) - (vterm) + ;; Don't open semi-broken vterms over tramp. + (if (file-remote-p default-directory) + (let ((default-directory "~")) + (vterm)) + (vterm)) (if-let ((buffer (get-buffer buffer-name))) (switch-to-buffer buffer) (error "Could not find vterm buffer: %s" buffer-name))))