Skip to content

Conversation

@amtoaer
Copy link
Contributor

@amtoaer amtoaer commented Jan 7, 2026

Closes #46084

I'm not very familiar with this part of the code, so I'm not sure if this is the right way to fix it.

During debugging, I discovered that marked_range_utf16 consistently stores an empty range representing the cursor position (e.g., 0..0, 1..1) instead of an actual marked range. This bug is caused by the range being empty.

In my testing, the IME starts working correctly as long as I change it to any non-empty range (e.g., 0..1). Although I suspect the correct value should probably be 0..marked_text.encode_utf16().count().

Before/After:

CleanShot.2026-01-07.at.10.36.51.mp4

Release Notes:

  • Fixed an issue where backspace fails to remove the last character of IME marked text in the terminal.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 7, 2026
@github-actions github-actions bot added the community champion Issues filed by our amazing community champions! 🫶 label Jan 7, 2026
@maxdeviant maxdeviant changed the title terminal: fix last character of IME marked text fails to be deleted terminal: Fix last character of IME marked text not being deleted Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement community champion Issues filed by our amazing community champions! 🫶

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Last character of IME marked text persists until extra backspace or new input

2 participants