Skip to content

@无法唤起文件选择 #266

Closed
Closed

Description

@yhtyanght

What version of Kimi Code is running?

0.6.0

Which open platform/subscription were you using?

/login

Which model were you using?

kimi-k2.6

What platform is your computer?

No response

What issue are you seeing?

@无法唤起文件选择

What steps can reproduce the bug?

必现 在文本框切换中英文下@都无法唤醒文件选择

What is the expected behavior?

主动递归识别当前目录下所有文件,@时可以可视化猜测可选项,进行选择

Additional information

No response

Activity

  1. added
    bug
    on Jun 1, 2026
  2. caigee-cmd commented on Jun 1, 2026

    @caigee-cmd
    Contributor

    跟踪了一下 @ 唤起文件选择的逻辑,分享下初步发现。

    @ 的触发判断主要在底层依赖 @earendil-works/pi-tui 里,kimi-code 这边的 file-mention-provider.ts 主要负责菜单弹出后的排序。pi-tui 里判断是否触发用的是 char === "@"(半角)。

    结合你提到的「切换中英文」,我怀疑原因是:中文输入法在全角标点模式下输入的是全角 @(U+FF20),而不是半角 @(U+0040),所以匹配不上、菜单不弹出。另外也可能与输入法上屏的方式有关,这点还需要确认。

    想请你补充几点信息来确认:

    1. 操作系统、终端、以及在用的输入法?
    2. 切到纯英文输入法、把 @ 作为一行开头输入时,菜单能正常弹出吗?
    3. 输入进去的是半角 @ 还是全角 @?
    4. 当前目录是否是 git 仓库、有没有装 fd?

    这些信息能帮助进一步定位。

  3. Aalivexy commented on Jun 1, 2026

    @Aalivexy

    检查当前目录是否是 git 仓库内,我之前测下来是只有 git 仓库内可以正常使用此功能

  4. zha-ji-tui commented on Jun 1, 2026

    @zha-ji-tui
    Contributor

    检查当前目录是否是 git 仓库内,我之前测下来是只有 git 仓库内可以正常使用此功能

    我刚刚测了下确实是,git仓库内才生效

  5. yhtyanght commented on Jun 1, 2026

    @yhtyanght
    Author

    没有git初始化,但是不一定只有编码才能用吧。我git init后可以用了。

  6. Eric-Song-Nop commented on Jun 1, 2026

    @Eric-Song-Nop
    Contributor

    似乎真正的需求是系统里有安装fd

  7. fancyboi999 commented on Jun 2, 2026

    @fancyboi999

    #305 should help with the root cause behind this: @ completion relies on fd for cross-directory search, and when fd is missing and you're outside a git repository there's no backend, so it failed silently.

    #305 makes the dependency explicit — it warns at startup in exactly that case (fd missing + not a git repo) and documents fd as a dependency, while inside a git repo the existing git ls-files fallback keeps @ working. It doesn't auto-install fd, so the fix is still to install fd (or work inside a git repo) — the change just makes the cause visible instead of silent. Builds on the warning idea from #290.

  8. chengkeen commented on Jun 2, 2026

    @chengkeen

    @ 文件选择需要 fd 或者 git 仓库作为后端数据源,当两者都没有时菜单不会弹出。

    建议安装 fd(apt install fd-find / brew install fd),安装后 detectFdPath() 会自动识别,在任意目录下 @ 文件选择都能正常工作。

    或者如果不想装 fd,在当前目录 git init 也可以让 @ 生效(走 git ls-files 后备)。

  9. liruifengv commented on Jun 8, 2026

    @liruifengv
    Collaborator

    在 #547 修复了,等发新版再试一下

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions