Support kitty keyboard protocol basic mode#888
Conversation
|
Thank you for the pull request.
I don't think this part is saying that all program should support kitty protocol. If that's true, every existing old program breaks. The feature is disabled by default and need to enable it if a program want to use it. I think it's great to support kitty keyboard protocol input. Assumed scenario is: Some program enabled it but forgot to disable it or crashed. Reline launched after that receives kitty keyboard protocol input. |
|
Thanks, that makes sense. What I wanted to highlight is that, in practice, current VS Code stable seems to expose kitty-coded input to users already. On my setup, I can reproduce this in current VS Code, but not in current Cursor on the same machine and shell setup, so this looks more like recent VS Code terminal behavior than just a shell-specific issue. There also seem to be similar user reports after the recent VS Code update: Another subtlety is that Reline may see kitty So I agree these are two separate questions:
Even if we drop the |
Summary
CSI ukey sequences into existing Reline key semanticsCtrl-Cworking by routing it through a dedicated interrupt actionTesting
./miniruby ./tool/runruby.rb --extout=.ext -- -Igems/src/reline/lib gems/src/reline/test/reline/test_key_stroke.rb./miniruby ./tool/runruby.rb --extout=.ext -- -Igems/src/reline/lib gems/src/reline/test/reline/test_ansi.rb./miniruby ./tool/runruby.rb --extout=.ext -- -Igems/src/reline/lib gems/src/reline/test/reline/test_reline.rbContext
This fixes broken key handling in terminals that enable kitty keyboard protocol basic mode.
A concrete regression target is the VS Code integrated terminal after the January 2026 VS Code 1.109 release notes announced kitty keyboard protocol support and the experimental
terminal.integrated.enableKittyKeyboardProtocolsetting:https://code.visualstudio.com/updates/v1_109
That release notes page says the feature "has been implemented and will be rolling out to stable this release" and that it "requires the program running in the terminal to support the protocol and request to enable it when it runs". In practice, this means
irb/relinecurrently mis-handle keys such as Backspace, Escape, Alt-modified keys, andCtrl-Cin the VS Code terminal unless the setting is disabled.This PR makes
relineopt into kitty keyboard protocol basic mode and interpret the resultingCSI ukey sequences soirbkeeps working correctly in that environment.