When using `@` to mention files, it should default to showing a list of all files rather than 'no matches'
What feature would you like to see?
Currently when we use @ to mention a file, it defaults to showing 'no matches':
▌@
▌no matches
But sometimes I don't remember the name of the file I want to mention straight away, and so need to separately check the folder externally, or prompt with an ls type command or similar.
It would be nice if typing @ defaulted to showing the list of files that I could then select from, rather than the less useful 'no matches'.
A current hacky workaround is to type @ followed by a vowel, and know that at least that way I will see some selection of files that I could pick from, but this feels like a bit of a hack, and there is still a 1 in 5'ish chance I wouldn't see the file I wanted still anyway.
Are you interested in implementing this feature?
Unfortunately I don't have the capacity to currently, nor the familiarity with rust.
5 Comments
Within
sync_file_search_popup, this part looks related to empty query:https://github.com/openai/codex/blob/3f8184034f12e2c03013273505259999acd03423/codex-rs/tui/src/bottom_pane/chat_composer.rs#L1188-L1204
And this is
FileSearchPopup'sset_empty_promptthat it calls:https://github.com/openai/codex/blob/3f8184034f12e2c03013273505259999acd03423/codex-rs/tui/src/bottom_pane/file_search_popup.rs#L57-L66
FileSearchPopup'sset_queryis also used when non-blank:https://github.com/openai/codex/blob/3f8184034f12e2c03013273505259999acd03423/codex-rs/tui/src/bottom_pane/file_search_popup.rs#L37-L55
The
FileSearchManager'son_user_queryfunction seems to relate to when the user edits the@token:https://github.com/openai/codex/blob/3f8184034f12e2c03013273505259999acd03423/codex-rs/tui/src/file_search.rs#L81-L82
And eventually calls
FileSearchManager::spawn_file_search:https://github.com/openai/codex/blob/3f8184034f12e2c03013273505259999acd03423/codex-rs/tui/src/file_search.rs#L148-L154
Which seems to call
file_search::run:https://github.com/openai/codex/blob/3f8184034f12e2c03013273505259999acd03423/codex-rs/tui/src/file_search.rs#L158-L177
Which calls
create_pattern:https://github.com/openai/codex/blob/3f8184034f12e2c03013273505259999acd03423/codex-rs/file-search/src/lib.rs#L124-L133
And then uses the same library that ripgrep uses:
https://github.com/openai/codex/blob/3f8184034f12e2c03013273505259999acd03423/codex-rs/file-search/src/lib.rs#L151-L153
create_patternseems to be a basic wrapper/helper:https://github.com/openai/codex/blob/3f8184034f12e2c03013273505259999acd03423/codex-rs/file-search/src/lib.rs#L357-L364
If we were just using
rgdirectly we could do something like the following to list the files:So something similar to that as the default when using a raw
@would be useful.---
One potential (naive) suggestion I iterated on with GitHub Copilot + GPT-5:
I can't even get the @ to show up using AltGr+2...
Potentially / tangentially related:
Thanks for the feature request. This has received only one upvote in three months, so I'm going to close it.
@etraut-openai anyway it seems to have been solved in a related PR. Have a good one