Skip to content

take advantage of kitty keyboard protocol #2131

@dankamongmen

Description

@dankamongmen

I thought i had a bug on this, but i guess not? https://sw.kovidgoyal.net/kitty/keyboard-protocol/ seems a reasonable thing to support. it would have a few parts:

  • move to the alternate screen before doing queries
  • lex the kitty protocol elements
  • query for support with CSI ? u
  • watch for support response of form CSI ? flags u
  • request stepup with CSI = flags ; 1 u
  • push the current keyboard handling state at startup with CSI > u
  • pop the keyboard handling state at exit with CSI < u
  • synthesize SIGINT and SIGQUIT

so throw the query into our initial query string. initialize keyflags to 0. if we get a CSI ? flags u response, write flags to keyflags, and emit stepup CSI = flags ; 1 u and push CSI > u.

decode the inputs regardless of what flags said.

at exit, if we pushed, pop with CSI < u.

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationenhancementNew feature or requestinputreadin' dem bytes

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions