Korean IME composing text appears at wrong position in terminal
Description
When typing Korean (or other CJK languages using IME) in the Claude Code prompt, the composing/preedit text appears at the wrong position -- typically near the bottom of the terminal instead of at the cursor location.
Steps to Reproduce
- Open a terminal (tested with Ghostty and a custom libghostty-based terminal)
- Run
claude - Switch to Korean input method
- Start typing Korean text (e.g., "한글")
- Observe that the composing character appears near the bottom of the screen, not next to the cursor
Expected Behavior
The IME composing text should appear at or near the cursor position in the Claude Code input prompt.
Actual Behavior
The composing text appears several lines below the cursor, near the bottom status bar area.
Environment
- macOS (Apple Silicon)
- Claude Code v2.1.83
- Terminal: Ghostty / libghostty-based terminal
- Input method: macOS Korean (2-Set)
Analysis
The terminal emulator correctly returns cursor coordinates via firstRect(forCharacterRange:) (NSTextInputClient protocol). The coordinates match the terminal-level cursor position.
The issue appears to be that Claude Code's TUI (ink-based) reports the cursor position to the terminal at a location different from where the visual input prompt cursor is rendered. The terminal cursor tracking and the visual cursor are out of sync, causing macOS to position the IME composing window at the terminal-level cursor rather than the visual cursor.
This issue reproduces in multiple terminal emulators (Ghostty, custom libghostty-based terminals), suggesting it is not a terminal-side bug.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗