Skip to content

Fix IME input and wide-character rendering in terminal view#73

Open
benenen wants to merge 1 commit intoHarzu:masterfrom
benenen:fix/textinput
Open

Fix IME input and wide-character rendering in terminal view#73
benenen wants to merge 1 commit intoHarzu:masterfrom
benenen:fix/textinput

Conversation

@benenen
Copy link
Copy Markdown

@benenen benenen commented Apr 10, 2026

Summary

  • add IME support to the terminal widget on Windows by handling input method open, preedit, commit, and close events
  • request input method updates while the terminal is focused so the platform can place composition UI correctly
  • fix wide-character rendering alignment to prevent overlap between trailing ASCII text and the first committed CJK character

Details

This change updates the terminal view to participate in iced's input method flow instead of relying only on raw keyboard events.
Preedit text is tracked in widget state without being written to the PTY, while committed text is forwarded through the existing
backend write path as UTF-8 bytes.

It also adjusts terminal rendering for full-width characters so CJK glyphs are positioned using wide-cell alignment, which fixes
the visual overlap that could occur between the last English character and the first Chinese character after IME commit.

Test plan

  • run cargo test
  • verify IME open/preedit/commit/close logic with unit tests
  • confirm committed IME text produces a single PTY write
  • confirm no PTY writes happen during preedit
  • manually verify English/Chinese input switching while terminal is focused
  • manually verify no overlap between trailing English text and the first committed Chinese character

🤖 Generated with Claude Code

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