Skip to content

Commit

Permalink
feat: don't delete shell/term windows via C-g
Browse files Browse the repository at this point in the history
  • Loading branch information
seagle0128 committed Jul 12, 2024
1 parent 2356e70 commit 1c7526b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lisp/init-window.el
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,16 @@
"Close popper window via `C-g'."
;; `C-g' can deactivate region
(when (and ;(called-interactively-p 'interactive)
(not (region-active-p))
popper-open-popup-alist)
(let ((window (caar popper-open-popup-alist)))
(when (window-live-p window)
(not (region-active-p))
popper-open-popup-alist)
(when-let ((window (caar popper-open-popup-alist))
(buffer (cdar popper-open-popup-alist)))
(when (and (with-current-buffer buffer
(not (derived-mode-p 'eshell-mode
'shell-mode
'term-mode
'vterm-mode)))
(window-live-p window))
(delete-window window)))))
(advice-add #'keyboard-quit :before #'popper-close-window-hack)))

Expand Down

0 comments on commit 1c7526b

Please sign in to comment.