Close window when hiding current shell

For eshell we do the same.
This commit is contained in:
Daniel - 2020-07-12 13:00:28 +02:00
parent 1252023886
commit ac815a06f1
No known key found for this signature in database
GPG Key ID: 1C7071A75BB72D64
1 changed files with 6 additions and 7 deletions

View File

@ -62,14 +62,13 @@ If already in `*ansi-term*' buffer, bury it."
(find-file user-init-file))
(defun db/run-or-hide-shell ()
"Opens an shell buffer if not already in one, and otherwise
returns to where we have been before."
"Opens an shell buffer if not already in one, and closes it
otherwise."
(interactive "")
(if (string= "shell-mode" major-mode)
(progn
(bury-buffer)
(other-window -1))
(shell)))
(if (not (eq 'shell-mode major-mode))
(shell)
(bury-buffer)
(delete-window)))
;;; General Utilities