Skip to content

prompt: fix cursor math for wide characters#27017

Merged
simonklee merged 1 commit into
devfrom
oc-fix-mention
May 12, 2026
Merged

prompt: fix cursor math for wide characters#27017
simonklee merged 1 commit into
devfrom
oc-fix-mention

Conversation

@simonklee
Copy link
Copy Markdown
Member

@simonklee simonklee commented May 12, 2026

String.length counts code points, not display columns, so CJK characters and emoji that occupy two terminal cells caused misaligned cursors, broken mention triggers, and incorrect history restoration offsets.

Use Bun.stringWidth for now, we need an alternative for this.

Fix #26716
Close #26922

String.length counts code points, not display columns, so CJK
characters and emoji that occupy two terminal cells caused
misaligned cursors, broken mention triggers, and incorrect
history restoration offsets.

Use Bun.stringWidth for now, we need an alternative for this.

Fix #26716
@simonklee simonklee merged commit 8f05bbf into dev May 12, 2026
8 of 9 checks passed
@simonklee simonklee deleted the oc-fix-mention branch May 12, 2026 09:45
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.

CJK and other unicode symbols preceeding @ (mention) causes "no matching items"

1 participant