Terminal hyperlink support for file references, with optional WSL-aware VS Code URL handling
What variant of Codex are you using?
CLI
What feature would you like to see?
I'd like Codex CLI to support clickable file references in terminal output as an opt-in feature, rather than always rendering them as plain text.
In particular, it would be useful if Codex could optionally emit OSC 8 hyperlinks for local file references that it already prints in responses, using the configured file_opener scheme when available. This would make file paths directly clickable in terminals that support hyperlinks.
I’d also like an additional opt-in mode for WSL users who open files through VS Code or VS Code Insiders running on Windows. In that setup, a plain vscode://file/... or vscode-insiders://file/... link is often not enough, because the editor is attached to the WSL environment rather than opening Linux paths as normal local Windows files. A WSL-aware mode could instead generate vscode-remote URLs based on the active distro, for example using WSL_DISTRO_NAME. The WSL URL format looks like this: vscode://vscode-remote/wsl+<distro-name>/<path-to-file-or-folder> (vscode or vscode-insiders for the scheme).
I do not think either behavior should necessarily be the default. Config flags would be enough. For example:
- a config option to enable terminal OSC 8 file hyperlinks
- a config option or mode to generate WSL-aware VS Code remote links instead of normal local file URLs
That would let people with compatible terminals and editor setups opt in without changing behavior for everyone else.
Additional information
I tested local OSC 8 hyperlinks in my environment and they work correctly in tmux inside Windows Terminal. Using Codex, I also created and tested a patched Codex build that made file references clickable, so this appears to be feasible from the renderer side.
The remaining issue in my setup is specifically WSL 2 plus VS Code Insiders on Windows. The terminal can handle the hyperlink, but the generated URL needs to target the WSL-connected VS Code window rather than a normal local file URL.
If it helps, I'd expect this feature to be most useful for setups like:
- Codex running inside WSL 2
- terminal supports OSC 8 hyperlinks
- editor opener configured as
vscodeorvscode-insiders - user wants file links to open in the existing WSL remote context
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗