muesli / termenv

Advanced ANSI style & color support for your terminal applications
MIT License
1.76k stars 73 forks source link

Implement Enable/Disable/Detect Kitty Keyboard Protocol #159

Closed maaslalani closed 3 months ago

maaslalani commented 1 year ago

This PR allows for enabling and disabling kitty keyboard protocol.

https://sw.kovidgoyal.net/kitty/keyboard-protocol/

This PR adds for returning the progressive enhancements so that the terminal application can detect which features are supported.

KittyKeyboardProtocolSupport() byte

The byte returned represents the bitset of supported flags.

0b1     (01) — Disambiguate escape codes
0b10    (02) — Report event types
0b100   (04) — Report alternate keys
0b1000  (08) — Report all keys as escape codes
0b10000 (16) — Report associated text