Only clean up after eshell window if visible

Killing buried eshell windows shouldn't delete windows or restore any
wconfs.
This commit is contained in:
Henrik Lissner 2018-06-28 14:47:14 +02:00
parent dc8c01f17f
commit 7bb9adc6bd
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -259,16 +259,17 @@ delete."
"Close window (or workspace) on quit."
(let ((buf (current-buffer)))
(when (+eshell--remove-buffer buf)
(+eshell--setup-window (get-buffer-window buf) nil)
(cond ((and (one-window-p)
(when-let* ((win (get-buffer-window buf)))
(+eshell--setup-window win nil)
(cond ((and (one-window-p t)
(window-configuration-p (frame-parameter nil 'saved-wconf)))
(set-window-configuration (frame-parameter nil 'saved-wconf))
(set-frame-parameter nil 'saved-wconf nil))
(set-frame-parameter win 'saved-wconf nil))
((one-window-p)
(let ((prev (save-window-excursion (previous-buffer))))
(unless (and prev (doom-real-buffer-p prev))
(switch-to-buffer (doom-fallback-buffer)))))
((or (and (fboundp '+popup-window-p) (+popup-window-p))
+eshell-kill-window-on-exit)
(delete-window))))))
(delete-window win)))))))