[PR #10647] fix: replace rg with fd to search empty directory #13510

Open
opened 2026-02-16 18:18:21 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/10647

State: open
Merged: No


What does this PR do?

Fixes #10637 and #11827

How did you verify your code works?

Why is it wrong now?

When we type '@', it will trigger File.search, which use ripgrep to retrieve all the files and directorys.

packages/opencode/src/file/index.ts

The command be excuted is rg --files ... eventually, and it only list files, we later use these files to extrapolate the directorys. The key point is that rg only list files.

How I resolved it?

Use fd to replace rg

I have verified it in

  • OS: macOS 15.6 / win11
  • OpenCode: 1.1.36
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/10647 **State:** open **Merged:** No --- ### What does this PR do? Fixes #10637 and #11827 ### How did you verify your code works? #### Why is it wrong now? When we type '@', it will trigger File.search, which use ripgrep to retrieve all the files and directorys. > packages/opencode/src/file/index.ts The command be excuted is `rg --files ...` eventually, and it only list files, we later use these files to extrapolate the directorys. The key point is that `rg` only list files. #### How I resolved it? Use [fd](https://github.com/sharkdp/fd) to replace rg #### I have verified it in - OS: macOS 15.6 / win11 - OpenCode: 1.1.36
yindo added the pull-request label 2026-02-16 18:18:21 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13510