Skip to content

Fix parsing multiple keys - #6592

Merged
willmcgugan merged 4 commits into
mainfrom
kitty-codepoints
Jun 24, 2026
Merged

willmcgugan merged 4 commits into
mainfrom
kitty-codepoints

Conversation

@willmcgugan

Copy link
Copy Markdown
Member

The kitty key protocol provide multiple characters in the text field for a single keypress, which Textual wasn't parsing.

When you hit option+n followed by a forward slash, the terminal sends a single sequence containing two text characters. Textual translates this into 2 key events, which results in apps doing the right thing.

Fixes #6562

@willmcgugan
willmcgugan merged commit 8ce58dc into main Jun 24, 2026
23 checks passed
@willmcgugan
willmcgugan deleted the kitty-codepoints branch June 24, 2026 05:57
ekzhu added a commit to agentscope-ai/QwenPaw that referenced this pull request Jul 1, 2026
Typing with an input method -- Chinese, Japanese, Korean, accented
Latin, ZWJ emoji, etc. -- leaked a raw terminal escape sequence into the
prompt instead of inserting the text. For example, typing "我知道"
produced:

    我[32;;19981:30693:36947u

Root cause is upstream in Textual. When an IME commits more than one
codepoint at once, the terminal sends them in a single Kitty
keyboard-protocol "associated text" field as colon-separated codepoints
(e.g. "\x1b[..;..;25105:30693:36947u"). textual<=8.2.7 neither matched
the colons in its CSI-u parser regex nor decoded past the first
codepoint, so the whole sequence surfaced as literal text.

textual 8.2.8 fixes this (Textualize/textual#6592) by parsing all
colon-separated codepoints and emitting one key event per codepoint.
Bump the dependency floor so the bundled TUI picks up the fix; no
QwenPaw code change is required.

Verified on textual 8.2.8: the parser turns the sequence into the three
key events 我 / 知 / 道, and the TUI unit suite passes.
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Jul 6, 2026
https://build.opensuse.org/request/show/1363872
by user dirkmueller + anag_factory
- update to 8.2.8:
  * Fixes for extended key processing, and a crash bug for
    clicking the screen padding area.
  * Fixed parsing Kitty extended keys with multiple codepoints
    Textualize/textual#6592
  * Fixed crash when clicking in the Screen's padding
    Textualize/textual#6598
  * super+backspace is now an alias for ctrl+u in Input and
    TextArea Textualize/textual#6594
  * alt+backspace (option+backspace on Mac) has the same effect
    as ctrl+backspace in Input and TextArea
alejandro-ao added a commit to huggingface/tau that referenced this pull request Jul 13, 2026
Textual 8.2.7 requests the kitty keyboard protocol's associated-text
reporting but cannot parse multi-codepoint text fields, so IME commits
(Chinese/Japanese/Korean) arrive in the input box as literal escape
sequences like [49;;20320:22909u. Textual 8.2.8 fixes the parser
(Textualize/textual#6592); raise the dependency floor so no install
resolves to a broken version.

Fixes #337

Co-authored-by: Alejandro AO <[email protected]>
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.

Kitty: Cannot write ~/ in TextArea

1 participant