anomalyco / anomalyco/opencode

CJK characters before cursor still break @ file autocomplete (1.18.9)

Open
#39,462 1 comment 0 reactions 1 assignee View on GitHub

@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
  1. Open the TUI and type Chinese text, e.g. 你好
  2. Immediately type @
  3. Observe: no file list appears
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.