Skip to content

Confirm before exiting Emacs when ghostel-query-before-killing applies - #681

Merged
dakra merged 1 commit into
mainfrom
fix/query-before-exit
Sep 13, 2026
Merged

dakra merged 1 commit into
mainfrom
fix/query-before-exit

Conversation

@dakra

@dakra dakra commented Sep 13, 2026 •

Copy link
Copy Markdown
Owner

Closes #672

ghostel-query-before-killing documented confirmation both on buffer kill and on Emacs exit, but only the buffer-kill half existed. Both spawn paths use :noquery, so save-buffers-kill-emacs never asked, and nothing was registered on kill-emacs-query-functions. The exit half was lost when the native PTY commit replaced the process-query-on-exit-flag toggling with a custom kill-buffer-query-functions hook.

  • Split the decision into ghostel--query-before-killing-p, shared by buffer kill and Emacs exit.
  • Add ghostel--kill-emacs-query on kill-emacs-query-functions: one prompt listing every ghostel buffer with a running command (auto) or live process (t).
  • Tests for the prompt, the silent case at a shell prompt, and hook registration.

Verified live in a sandboxed terminal Emacs with zsh integration: less running plus C-x C-c prompts and n keeps Emacs alive; after quitting less, C-x C-c exits silently under auto; with the hook removed the original silent exit reproduces.

The option's docstring promised confirmation both on buffer kill and on
Emacs exit, but only the buffer-kill half existed: both spawn paths use
:noquery so save-buffers-kill-emacs never asked, and nothing was on
kill-emacs-query-functions.

Split the decision into ghostel--query-before-killing-p and add
ghostel--kill-emacs-query, which asks once listing every ghostel buffer
the predicate flags.

Closes #672
@dakra
dakra force-pushed the fix/query-before-exit branch from 428220b to 86e8c44 Compare September 13, 2026 11:06
@dakra
dakra merged commit 86e8c44 into main Sep 13, 2026
27 checks passed
@dakra
dakra deleted the fix/query-before-exit branch September 13, 2026 11:09

This branch was successfully deployed

1 active deployment
github-pages — 86e8c44c Deployed Sep 13, 2026 by dakra via deploy #184
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ghostel-query-before-killing does not prompt when exiting Emacs

1 participant