Skip to content

Fix incorrect IME input window positioning when "multiline input + specific conditions" occur#45

Merged
jacob314 merged 5 commits intojacob314:masterfrom
iblea:pr-44-multilinefix
Jan 27, 2026
Merged

Fix incorrect IME input window positioning when "multiline input + specific conditions" occur#45
jacob314 merged 5 commits intojacob314:masterfrom
iblea:pr-44-multilinefix

Conversation

@iblea
Copy link

@iblea iblea commented Jan 24, 2026

The issue occurs in multiline when the following two conditions are met:

  • It must not be the last line.
  • The cursor must move to the end of the line.

The video of the issue is as follows.

bug.mp4

FWIW in Gemini CLI we split the input into lines anyway so there is no wrapping for the text used as an input so we don't need to handle these cases perfectly.

This issue only occurs in examples/multi-input/multi-input.tsx and does not occur in Gemini-CLI.
It doesn't seem to be a significant problem for use in GEMINI CLI.

The reproduction of the issue is as follows.

  1. NODE_NO_WARNINGS=1 node --loader ts-node/esm examples/multi-input/index.ts
  2. Write the following text. (Use a Korean input method.)
안녕
반갑습니다.

Select Korean - Dubeolsik input method, and type the following English characters based on the QWERTY keyboard layout.

dkssud(Ctrl+J)
qksrkqtmqslek.
  1. Position the cursor at the very end of the first line.
  2. Type text in Korean or Japanese to display the IME candidate window.
  • The IME candidate window is not displayed on the same line, but rather on the first character of the next line.

jacob314 and others added 3 commits January 21, 2026 17:30
More IME fixes

Checkpoint.

Cursor simplifications
Remove enableImeCursor and move the cursor to the appropriate
location without making the cursor be visible.

Gemini CLI will continue to render its own cursor so there is no need
to show the cursor as that introduces visual artifacts. Gemini CLI does
however need the cursor position to be at the correct location so IME
input works as expected.

Fixes for incremental updates in non-alternate buffer mode and tests.
… spaces

- Rename currentLineStartOffset to previousLineEndOffset for clearer semantics
- Add early exit to avoid unnecessary iteration
- Keep cursor at end of previous line instead of jumping to next line in gap area
- Add comments for code clarity
@jacob314
Copy link
Owner

Please resolve the merge conflicts then I'll take a look

Copy link
Owner

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!lgtm

@jacob314 jacob314 merged commit c1b7ea8 into jacob314:master Jan 27, 2026
1 check passed
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.

2 participants