From 9007d032a97969d592795404a47ef10a3a88ebb0 Mon Sep 17 00:00:00 2001 From: Jessie Hildebrandt Date: Sat, 17 Oct 2020 18:12:40 -0400 Subject: [PATCH] Update open-default-shell function --- init.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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)