Skip to content

Commit

Permalink
Fix a bug with deleting the last frame on a terminal
Browse files Browse the repository at this point in the history
For some reason, Emacs thinks it's deleting the last frame when it's
not, so we just use the FORCE argument to "delete-frame" because
we (presumably) know better.
  • Loading branch information
DarwinAwardWinner committed Dec 1, 2024
1 parent 723387e commit 1ed0e9c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pseudo-daemon.el
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,13 @@ as normal, so that the pseudo-daemon can do its work."
(apply orig-fun args))))

(defsubst pseudo-daemon-delete-all-frames-on-terminal (terminal)
"Call `delete-frame' on all frames on TERMINAL"
(mapc #'delete-frame (pseudo-daemon--terminal-frame-list terminal)))
"Call `delete-frame' on all frames on TERMINAL."
;; We use the FORCE argument to `delete-frame' here, because
;; otherwise when it gets to the "last" frame, it thinks that the
;; frame is still last even after running
;; `pseudo-daemon-make-hidden-frame' first.
(mapc (lambda (frm) (delete-frame frm t))
(pseudo-daemon--terminal-frame-list terminal)))

(defun save-buffers-kill-terminal@pseudo-daemon (orig-fun &rest args)
"Advice implementing `pseudo-daemon-mode'.
Expand Down

0 comments on commit 1ed0e9c

Please sign in to comment.