Korean IME composition window appears at wrong position (bottom-left of terminal)
Korean IME composition window appears at wrong position (bottom-left of terminal)
Summary
When typing Korean (or other CJK languages) in Claude Code, the IME composition/candidate window renders at the bottom-left corner of the terminal instead of at the cursor position. This makes Korean input extremely difficult — the composing character appears far from where text is being typed.
Environment
- OS: macOS (Darwin 25.2.0)
- Claude Code model: Opus 4.6
- Input method: macOS default Korean input (2-set / du-beol-sik)
- Terminal: iTerm2 / Terminal.app (reproducible in both)
Steps to Reproduce
- Launch Claude Code in a terminal on macOS.
- Switch to Korean input method.
- Type Korean text in the input prompt (e.g., keystrokes for "한글").
- Observe where the IME composition window appears.
Expected Behavior
The IME composition window should appear directly adjacent to the text cursor in the input field.
Actual Behavior
The IME composition window appears at the bottom-left corner of the terminal, completely detached from the input area:
- Split attention: The composing syllable (ㅎ → 하 → 한) appears far from where text is inserted.
- Disorienting feel: Characters feel "pushed away" or "lagging" due to spatial disconnect.
- Affects all Korean input: Korean users all experience this.
Screenshot
<img width="368" height="89" alt="Image" src="https://github.com/user-attachments/assets/2a54d137-b4c7-403c-9f01-51717df2c7bc" />
Technical Analysis
Root Cause
Claude Code uses React Ink, which hides the real terminal cursor and renders a fake cursor via chalk.inverse(). macOS IME relies on the real terminal cursor position to place the composition window. Since the real cursor is hidden, the IME window falls back to position (0,0).
The Fix: Ink's useCursor API
Ink 6.7.0 introduced useCursor (PR #866) which moves the real terminal cursor to specified coordinates after each render:
import { useCursor } from 'ink';
import stringWidth from 'string-width';
const { setCursorPosition } = useCursor();
setCursorPosition({
x: stringWidth(prompt + textBeforeCursor),
y: inputRow,
});
Local verification: Tested with ink@6.7.0 + useCursor — IME composition window appears at the correct position. Korean input works as expected.
Related Issues
- #1547, #2620, #3045, #16372, #19207, #21382
Proposed Fix
- Integrate
useCursorfrom ink >=6.7.0 into Claude Code's text input component - Use
string-widthfor CJK-aware cursor column calculation - Show the real terminal cursor alongside the existing visual cursor
Upstream PRs
ink-text-input#93: Add IME cursor positioning viauseCursor@inkjs/ui#24: Add IME cursor positioning to TextInputink#876: Improve cursor-ime example with full TextInputink#866:useCursorhook (merged)ink#872:<Cursor>component (open)
Reproduction
Available at korean-terminal:
| Script | Description | IME behavior |
|--------|-------------|--------------|
| npm run test1 | Fake cursor (current behavior) | IME at bottom-left (broken) |
| npm run test2 | useCursor with real cursor | IME at correct position (fixed) |
| npm run test3 | Full TextInput + useCursor | IME at correct position (fixed) |
15 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
This is not a duplicate — it is a consolidation with a concrete fix.
The referenced issues (#16372, #19207, #6342) were all closed, but the underlying problem still exists as of today. The IME composition window still appears at the bottom-left corner of the terminal when typing Korean in Claude Code.
What makes this issue different
npm run test1/test2/test3) showing the broken vs fixed behaviorink-text-input#93—useCursorintegration@inkjs/ui#24—useCursorintegrationink#875— improved cursor-ime exampleuseCursor(ink >=6.7.0) +stringWidthcorrectly positions the IME windowPlease keep this open as the canonical tracking issue for CJK IME positioning.
Reproduction video (macOS, iTerm2, Korean IME)
I recorded a short screen capture demonstrating this issue.
https://github.com/user-attachments/assets/cb1fe7d3-8cd9-4b79-9263-553fcf996f3d
Environment:
What's happening:
the terminal instead of next to the actual cursor position.
disorienting — almost like audio feedback/howling on a speakerphone call.
Looking forward to the
useCursorfix landing. Thanks for tracking this!Cross-comparison: Gemini CLI and Codex CLI handle Korean IME correctly
Adding a data point from Windows (MSYS2/bash, Windows Terminal).
Environment:
Comparison with other AI CLI tools:
| CLI Tool | IME Inline Composition | Jamo visible at cursor |
|----------|----------------------|----------------------|
| Claude Code | No — composition window at bottom-left (0,0) | No |
| Gemini CLI | Yes — inline at cursor position | Yes |
| OpenAI Codex CLI | Yes — inline at cursor position | Yes |
Both Gemini CLI and Codex CLI show real-time jamo composition (ㅎ → 하 → 한) directly at the input cursor. Claude Code is the only one among the three where the composition falls to the bottom-left corner.
Why this matters for prioritization:
This is not an edge case — it affects every Korean-speaking user on every session. Competing CLI tools have already solved this, which makes the UX gap very noticeable in daily use. Gemini CLI addressed this by forking Ink and adding
terminalCursorPositionsupport (google-gemini/gemini-cli#17711). The upstreamuseCursorhook (ink >=6.7.0) provides a non-fork path to the same fix.Looking forward to this being resolved. Thanks to @subinium for the thorough root cause analysis and upstream PRs.
Japanese IME too
I can confirm this issue also affects Japanese IME input on WezTerm on linux — a terminal emulator with first-class IME support.
Vim and other TUI apps handle inline Japanese input correctly in WezTerm, but Claude Code does not. This makes the problem clearly Claude Code-specific, not a terminal limitation.
I want to also flag a concerning pattern in how this has been handled:
The fix is well-understood and already available: useCursor from ink >= 6.7.0 has been merged upstream. Competing CLI tools (Gemini CLI, OpenAI Codex CLI, even Open Code) have already solved this. Claude Code is the outlier.
Please don't close this as a duplicate of already-closed issues that were themselves closed incorrectly. This bug is still present and affects all CJK users daily.
Reproduction on Windows 11 + Windows Terminal
Environment:
Observed behavior:
Korean IME composition characters appear at the bottom of the Claude Code UI, outside the input area — identical to the behavior described in this issue. The composing syllable is spatially disconnected from the cursor position, making Korean input disorienting.
Screenshot showing Korean characters leaking to the bottom of the UI:
The fix proposed here (integrating useCursor from ink 6.7.0) would resolve this on Windows as well. Upvoting for prioritization.
Claude Code's React Ink TUI hides the real terminal cursor and replaces it with a styled fake one — so the OS IME has no cursor position to anchor to and falls back to (0,0). The dev fix is the
useCursorhook from Ink 6.7.0. User workarounds + upstream PR links: https://cacheoverflow.dev/blog/M5yrbtvzReproduction on Windows 11 + Google Japanese Input
Environment:
Specific trigger:
Observed behavior:
Ctrl+Lor window resizeThis is not limited to specific characters — any input during active conversion triggers the freeze + artifact.
Tested Windows Terminal settings (none resolved the issue):
experimental.rendering.forceFullRepaint: trueuseAtlasEngine: falserendering.graphicsAPI: direct3d11Confirming this affects Japanese IME users on Windows as well. Looking forward to the
useCursorfix.Hi team, I'm also experiencing this issue on macOS.
When typing Korean (Hangul) in the Claude Code CLI input field, the IME composition (preedit) text appears at the bottom-left corner of the terminal window instead of inline at the cursor position. Once the composition is committed, the text appears correctly in the input field.
This happens with both 2-Set (두벌식) and 3-Set (세벌식) Korean keyboard layouts, and is not specific to any particular input
method — I've tested with the default macOS Korean IME as well as third-party ones.
Notably, other CLI tools like Gemini CLI handle IME inline composition correctly in the exact same terminal environment, which confirms this is not a terminal limitation but an issue with how Claude Code handles IME input.
Would love to see this fixed — it makes Korean input quite difficult to use as there's no visual feedback at the actual typing position during composition.
@qing-ant 问题仍然存在呀,为何关闭
when the screen is rotated 90 degrees to the vertical position, the input method has always been displayed at the lower left corner.
<img width="1105" height="1033" alt="Image" src="https://github.com/user-attachments/assets/b2db9e05-ae7e-4080-ac11-d5172a5fd30f" />
This is NOT resolved and remains completely unusable for CJK users. @qing-ant, why was this closed as "completed" without an actual fix? bug is still consistently reproducible.
It is not resolved and still reproducible quite clearly. Why is it closed as completed? It is so simple. Please try to type CJK on Codex, Gemini Cli and Claude Code.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.