anomalyco / anomalyco/opencode
CJK characters before cursor still break @ file autocomplete (1.18.9)
@kommander is already working on this.
Since Jul 29, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
In the TUI, typing @ after CJK characters does not trigger file autocomplete — no candidates appear. With a space before @, or with pure-ASCII text before it, autocomplete works.
Reported on 1.14.x/1.15.0 and auto-closed (stale), but still reproduces on 1.18.9, so the underlying offset bug is unfixed.
Suspected root cause (per #3734 / #20852): cursor position is computed with display width (CJK = 2 columns) but passed to value.slice() / lastIndexOf('@') as a character index, so @ is never located when CJK precedes it.
Plugins
none
OpenCode version
1.18.9
Steps to reproduce
- Open the TUI and type Chinese text, e.g.
你好 - Immediately type
@ - Observe: no file list appears
- Insert a space before
@(or use only ASCII text before@): the file list appears as expected
Screenshot and/or share link
(none)
Related
#3734 (root cause), #20852, #27293 (required spaces = CJK char count − 2), #27003, #26716 — all auto-closed at 60 days, not fixed
Operating System
Ubuntu 26.04 LTS
Terminal
tmux (TERM=tmux-256color), LANG=en_US.UTF-8
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.