Skip to content

fix(tui): preserve IME input in iTerm2 - #4

Merged
DongyunZou merged 1 commit into
mainfrom
fix/iterm-ime-input
Aug 12, 2026
Merged

fix(tui): preserve IME input in iTerm2#4
DongyunZou merged 1 commit into
mainfrom
fix/iterm-ime-input

Conversation

@DongyunZou

Copy link
Copy Markdown
Contributor

Summary

  • disable Textual's Kitty keyboard protocol when hmz runs directly in iTerm2, restoring Chinese and other IME-composed input
  • keep the protocol enabled when iTerm2 is behind tmux, where input already works and extended keys remain useful
  • respect an explicit TEXTUAL_DISABLE_KITTY_KEY choice and configure Textual before its first import

Root cause

Textual enables Kitty's report-all-keys and associated-text modes. iTerm2's direct handling of that combination loses IME-composed text before it reaches the TextArea. tmux changes the terminal protocol boundary and does not reproduce the failure.

This uses Textual's supported compatibility switch rather than modifying its input driver or handling composed text inside the editor.

Test plan

  • uv run pre-commit run --all-files
  • uv run pytest (1096 passed, 58 skipped)
  • manually confirmed Chinese IME input in direct iTerm2

@DongyunZou
DongyunZou merged commit 9a760cf into main Aug 12, 2026
4 checks passed
@futrime
futrime deleted the fix/iterm-ime-input branch August 30, 2026 02:05
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.

1 participant