After leaving Emacs open overnight, the SSH connection expires. However, the buffers that I left open, are still useful, and I want to continue working with them.
However, any action I do with Emacs (either using ivy-swiper or counsel-M-x, or ivy-switch-buffer) in the expired TRAMP buffer leads to an attempt of reconnecting to SSH, which is very annoying as it requires to enter password.
Is there a way to stop Emacs from trying to reconnect on every action that does not require a fresh version of a file explicitly?
This is my TRAMP config:
(use-package tramp :straight nil :init (setq tramp-terminal-type "tramp") (setq server-port "1492") (setq server-use-tcp t) (setq auth-source-save-behavior nil) :config (add-to-list 'tramp-connection-properties (list nil "remote-shell" "/bin/zsh")) (setq tramp-completion-reread-directory-timeout nil) (setq tramp-default-method "sshx") (setq tramp-use-ssh-controlmaster-options nil) (setq vc-ignore-dir-regexp (format "\\(%s\\)\\|\\(%s\\)" vc-ignore-dir-regexp tramp-file-name-regexp)) (setq tramp-verbose 5) (setq remote-file-name-inhibit-cache nil) (setq tramp-auto-save-directory "~/.emacs.d/tramp-autosave") )