Skip to content

Fix parsing multiple keys#6592

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

Fix parsing multiple keys#6592
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.
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