🐞 Bug: Emacs frame quits on focus loss after eshell completion with cape and frames-only-mode
Thank you for reporting a bug.
Checklist:
- [x] Using the latest stable release of Emacs 30.1
- [x] Started with
emacs -Qorpackage-isolate - [x] All related packages are up-to-date and reinstalled
Describe the bug
When using the cape and frames-only-mode extensions together, starting a completion in eshell (e.g., ls -<TAB>) and then clicking on a non-Emacs frame (such as a window from another application) causes the Emacs frame where the completion was started to quit unexpectedly.
To Reproduce Steps to reproduce the behavior:
- Install and enable
capeandframes-only-mode. - Optionally, install
pcmpl-args(may not be directly related, but was present). - Start Emacs with
emacs -Qor usingpackage-isolate. - Open eshell.
- Type
ls -<TAB>to trigger shell completion. - While the completion popup is active, click on a window from another application (non-Emacs frame).
- Observe that the Emacs frame that started completion quits or closes.
Expected behavior The Emacs frame should remain open and stable, regardless of window focus changes during completion.
Actual behavior The Emacs frame that started the completion is unexpectedly closed or quits when focus is switched away during an active completion.
Additional context
- Unsure whether
pcmpl-argsis necessary for the bug, but it was present. - This may be an interaction between completion popups,
frames-only-mode, and how focus events are handled. - Quit was present in the Messages buffer.
- This behavior was reliably reproducible on my machine.
Environment
- Emacs version: 30.1
- OS: [please specify]
- cape: [latest]
- frames-only-mode: [latest]
- pcmpl-args: [latest, optional]
- Started with:
emacs -Qorpackage-isolate
Stack traces / error messages Please let me know if further debugging output is needed.