Repository navigation
Open
Labels
Papercuts 2026TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displayenhancementNew feature or request
Description
What feature would you like to see?
Support absolute paths and ~ (home) expansion in @ file mentions / fuzzy file search in Codex TUI (and ideally aligned behavior in app-server fuzzy search).
Examples that should work:
@/home/alice/project/src/main.rs@~/project/src/main.rs@~/project/src/mai(fuzzy completion)
Why this matters
Today, @ search works well for relative-in-workspace paths, but fails for common path forms users type from shell habit:
- absolute filesystem paths
- home-relative paths using
~
This creates friction when referencing files outside current relative context or when users naturally paste absolute paths from terminal/editor.
Current behavior (from source)
From codex-rs current main:
@tokenquery is forwarded as raw text (no path normalization / tilde expansion).- file-search indexes and returns relative paths from search roots.
- selected popup match inserts that relative path.
So @~/... is treated literally and absolute-prefix query matching is not first-class.
Suggested behavior
- Recognize and normalize path-like
@queries before fuzzy matching:
- expand
~to user home - detect absolute paths
- normalize separators and dot segments
- Resolve query against active search roots:
- if query points inside a configured root, fuzzy-match the relative suffix within that root
- if query resolves outside current roots, either:
- show a clear "outside search roots" message, or
- optionally propose/add as an extra search root (future enhancement)
- Preserve current behavior for plain fuzzy tokens (non path-like input).
Nice-to-have
-
Add tests for:
@~/...expansion- absolute path inside root
- absolute path outside root
- mixed separator cases (Windows + POSIX)
-
Align app-server fuzzy file search semantics with TUI for consistency.
Additional information
Related existing issues around @ search UX:
- Support
@for fuzzy file search #1261 (support@fuzzy file search) - When using
@to mention files, it should default to showing a list of all files rather than 'no matches' #2867 (default list UX) - Allow selecting directories in @ file search #8863 (directory selection)
- Search @ cannot search from directories excluded by .gitignore #2952 (gitignore scope)
Reacted by deathraceDj, Huang Zhaobin, meowameowameow, AuroraGeeker, Erik Krogen and Roman Berezkin
Metadata
Metadata
Assignees
Labels
Papercuts 2026TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displayenhancementNew feature or request
Activity
oxysoft commentedon Mar 14, 2026
Linking #14673 here because it feels like the broader sibling issue.
This ticket is specifically about absolute paths and
~expansion inside@file mentions / fuzzy search. #14673 generalizes the expectation to the composer itself: if the user is typing path-shaped tokens like/...,~/...,../..., or./...inline, Codex should offer shell-like path completion there too.These two issues probably want to share backend/path-normalization semantics even if the UI surfaces differ.
akramdotsh commentedon Jul 27, 2026
Confirmed this limitation still exists in Codex CLI
0.145.0on macOS.Reproduction:
@followed by an absolute path,~/..., or../...pointing outside the repository.--add-dir /path/to/external/directoryand repeat.@autocomplete still searches only the primarycwd.This is separate from sandbox permissions. It also reproduces with
sandbox_mode = "danger-full-access".It would be useful for
@search to include all explicit--add-dirroots. A persistent config option such asfile_search_rootsor equivalent would also help users who regularly reference files across repositories, while preserving the current repository as the primary working directory.