Fix Ctrl+C not exiting under the kitty keyboard protocol - #96
Open
nielsenko wants to merge 2 commits into
Open
Conversation
The kitty keyboard protocol makes a terminal send ESC[99;5u rather than 0x03, and the tty raises SIGINT only for the byte, so the signal handler never fired. The key path now shuts down on an unhandled Ctrl+C. Ctrl+Shift+C is excluded, being copy.
Split across two files: a TerminalBinding registers VM service extensions that cannot be undone, so only one can exist per isolate.
nielsenko
force-pushed
the
fix/ctrl-c-kitty-protocol
branch
from
August 7, 2026 10:35
6c2fa2e to
0eb8df9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ctrl+C did nothing in most modern terminals. The app could only be killed from another shell.
The binding pushes the kitty keyboard protocol (\x1B[>1u) at startup. A terminal that supports it reports Ctrl+C as ESC[99;5u rather than the raw 0x03 byte, and the tty raises SIGINT only for the byte. So the SIGINT handler (which held the only shutdown fallback) never fired. The key path parsed the event correctly, routed it through the component tree, and discarded the result, two lines below a comment claiming it would fall back to shutdown.
Fix
The key path now shuts down on an unhandled Ctrl+C, as the comment already said it did. Ctrl+Shift+C is excluded (terminals bind it to copy), and the protocol reports the two distinctly.