Skip to content

Kill the partially created buffer when terminal creation quits#537

Closed
dakra wants to merge 2 commits into
mainfrom
fix/kill-buffer-on-quit
Closed

Kill the partially created buffer when terminal creation quits#537
dakra wants to merge 2 commits into
mainfrom
fix/kill-buffer-on-quit

Conversation

@dakra

@dakra dakra commented Jul 13, 2026

Copy link
Copy Markdown
Owner

ghostel--create cleans up after error but quit is not a subtype of error, so a keyboard quit during initialization — e.g. answering C-g to a dir-locals prompt while ghostel-mode runs hack-dir-local-variables — skipped the cleanup and left behind an empty ghostel-mode buffer with no terminal and no process (a blank *ghostel*<N> husk that plain M-x ghostel never reuses, since it has no buffer identity).

The handler now catches (error quit), killing the partial buffer before re-signaling.

The regression test signals quit from inside initialization and asserts no buffer survives; it uses condition-case directly because ERT's should-error only traps error. Verified to fail without the fix.

dakra added 2 commits July 13, 2026 19:58
ghostel--create cleaned up after errors but not after C-g: quit is not
a subtype of error, so a keyboard quit during initialization (e.g. at a
dir-locals prompt in ghostel-mode) left behind an empty ghostel-mode
buffer with no terminal and no process.
The test typed "abc" and required it to vanish from the screen after a
backspace.  fish's default prompt shows the checkout's VCS state, which
on the detached HEAD CI tests is the short merge-commit sha — PR merge
shas containing "abc" (like babcf18) kept the marker permanently on
screen and timed the test out.  Type "wxyz" instead: letters outside
[0-9a-f] can never appear in a sha.
@dakra

dakra commented Jul 13, 2026

Copy link
Copy Markdown
Owner Author

merged into main

@dakra dakra closed this Jul 13, 2026
@dakra dakra deleted the fix/kill-buffer-on-quit branch July 13, 2026 20:29
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.

1 participant