summary refs log tree commit diff stats
path: root/user
diff options
context:
space:
mode:
authorAlan Pearce2023-03-15 21:50:26 +0100
committerAlan Pearce2023-03-15 21:50:26 +0100
commit8c56a91570ec8fe9839378851878f578968e5dfb (patch)
treee48c97cdf6fe1fe9666156c40f91abd247efc54d /user
parentb8c921a8025e1d5aaca8a25881edcb400fba0d35 (diff)
downloadnixfiles-8c56a91570ec8fe9839378851878f578968e5dfb.tar.lz
nixfiles-8c56a91570ec8fe9839378851878f578968e5dfb.tar.zst
nixfiles-8c56a91570ec8fe9839378851878f578968e5dfb.zip
emacs: close eshell buffer and window when running `exit`
Diffstat (limited to 'user')
-rw-r--r--user/emacs/init.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/user/emacs/init.el b/user/emacs/init.el
index 702a60d6..5def6aee 100644
--- a/user/emacs/init.el
+++ b/user/emacs/init.el
@@ -697,10 +697,12 @@ _p_rev       _u_pper              _=_: upper/lower       _r_esolve
   :init (progn
           (with-eval-after-load 'evil-ex
             (evil-ex-define-cmd "esh[ell]" #'eshell)))
-  :config (setq eshell-prompt-function (lambda ()
-                                         (concat (eshell/pwd) "\n$ "))
-                eshell-prompt-regexp "^[$][[:blank:]]"
-                eshell-cmpl-cycle-completions nil))
+  :config (progn
+            (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)))
 
 (use-package eshell-toggle
   :after projectile