Repository navigation
make file references, fuzzy search & grep tool work on windows - #2665
Closed
itsrainingmani wants to merge 7 commits into
Closed
itsrainingmani wants to merge 7 commits into
itsrainingmani wants to merge 7 commits into
Conversation
…ead. escape the fzf filepath in the files function. escape the ripgrep filepath in the search function
itsrainingmani
marked this pull request as ready for review
September 19, 2025 14:45
github-actions
Bot
force-pushed
the
dev
branch
from
September 29, 2025 05:53
f16de3d to
cc0d460
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issues - #631, #2430
Issues
Currently, there are a few file related features broken in Windows.
@only shows agents and files with git diffs. Continuing to search for a filename doesn't show files that match the input@displays afailed to send message. 400 Bad Request - Error: ENOENT: no such file or directory, scandir <directory-of-file>error.Fixes
rg --files --follow --hidden --glob='!.git/*' | fzf --filter=<input-query> | head -n <input-limit>and running it via Bun Shell. Unfortunately, Bun Shell doesn't yet implement
headcausing anyheadinvocations on Windows to fail. We bypass this by falling back to limiting the results array instead on Windows.decodeURIComponentinpackages/opencode/src/session/prompt.ts. This results in a Windows file path that looks like this -/C:/Users/Username/samplefile.ts. The extra/at the start and the/separators prevent this from being a valid windows file path. Instead, we use thefileURLtoPathfunction in Bun to create a valid, cross-platform filepath from the message part URL.greptool sets the working directory for ripgrep to be the current directory (in absolute path terms) which causes ripgrep to output matches also in absolute path terms (which includes the Drive letter on Windows. This causes the line splitting logic to fail since the Windows Drive Letter includes a:). If we skip doing this, ripgrep will output matches in relative path terms and we can avoid having to write platform specific line splitting.