diff --git a/init.el b/init.el index a443b04..66fd18e 100644 --- a/init.el +++ b/init.el @@ -297,9 +297,13 @@ (lisp-interaction-mode)))) (defun open-default-shell () - "Opens the default system shell in a terminal emulator." + "Opens the default system shell in a terminal emulator, opening existing shell session if present." (interactive) - (term shell-file-name)) + (if (get-buffer "*terminal*") + (switch-to-buffer "*terminal*") + (progn + (ansi-term shell-file-name) + (rename-buffer "*terminal*")))) ;; Set up all custom bindings (non-package-specific) (bind-keys ([f6] . visual-line-mode)