TUI: support zsh-style directory traversal for @ file mention completion

Resolved 💬 1 comment Opened May 6, 2026 by Steve-Tod Closed Jul 1, 2026

Feature request

In the Codex CLI TUI, @ file mention completion currently accepts the highlighted candidate as a complete mention when pressing Tab/Enter. For directory candidates, it would be useful if Tab could accept the highlighted directory segment as a prefix and keep completion active, similar to path completion in zsh.

Current behavior

  1. Type an @ file mention prefix, for example @src.
  2. The completion UI highlights a matching directory, for example src.
  3. Press Tab.
  4. Codex inserts/accepts the highlighted item as the final mention, so continuing into subfolders requires typing more of the path before accepting or manually editing afterward.

Desired behavior

For directory candidates, pressing Tab should be able to accept the highlighted directory as a path prefix, insert a trailing slash, and keep file completion open:

@src<Tab>        -> @src/
@src/components<Tab> -> @src/components/

This would make @ file mentions behave more like zsh path completion, where repeated tabbing/typing can progressively traverse directories before selecting the final file or folder.

Why this helps

In large repositories, users often know the top-level directory first, then narrow down interactively. The current accept-as-final behavior makes @ mentions slower than normal shell path completion for nested files.

Environment

  • Codex CLI: codex-cli 0.128.0
  • Shell: /bin/zsh
  • Terminal: screen-256color
  • Platform: Linux x86_64

Related

This is related to, but distinct from, #6915. That issue covers other @ completion convenience/bug behavior; this request is specifically for zsh-style incremental directory traversal while composing @ file mentions.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗