branch: externals/detached
commit 21f17e0be31b0627be279bcbda408f2bd35f8b5f
Author: Niklas Eklund <[email protected]>
Commit: Niklas Eklund <[email protected]>
Update detach from session command
Check if the session window is a single window or not. Don't try to
delete the window if there is only one, Emacs gets sad then.
---
detached.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/detached.el b/detached.el
index 05a3fc9603..8e5ac5a7ad 100644
--- a/detached.el
+++ b/detached.el
@@ -597,7 +597,9 @@ active session. For sessions created with
`detached-compile' or
(comint-simple-send process detached--dtach-detach-character)
(message "[detached]"))
(setq detached--buffer-session nil)
- (kill-buffer-and-window))
+ (if (= (length (window-list)) 1)
+ (kill-buffer)
+ (kill-buffer-and-window)))
(if (eq 'active (detached--determine-session-state
detached--buffer-session))
;; `detached-eshell'
(if-let ((process (and (eq major-mode 'eshell-mode)