emacs: don't delete eshell window on `exit` if last window
Alan Pearce alan@alanpearce.eu
Sat, 18 Mar 2023 22:53:30 +0100
1 files changed, 3 insertions(+), 1 deletions(-)
jump to
M user/emacs/init.el → user/emacs/init.el
@@ -702,7 +702,9 @@ (setq eshell-prompt-function (lambda () (concat (eshell/pwd) "\n$ ")) eshell-prompt-regexp "^[$][[:blank:]]" eshell-cmpl-cycle-completions nil) - (add-hook 'eshell-exit-hook #'evil-window-delete))) + (add-hook 'eshell-exit-hook (lambda () + (when (window-deletable-p) + (delete-window)))))) (use-package eshell-toggle :after projectile