Skip to content

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

Closed as not planned

Description

@fanmeng-felix

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

Activity

  1. github-actions commented on Jul 29, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If the underlying fix was never merged and this still reproduces on 1.18.9, a maintainer may want to re-open or link the original tracking issue rather than close this as a duplicate.

  2. github-actions commented on Sep 28, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions