Remote File URI Opener
Open OSC 8 file:/// terminal hyperlinks (from CLIs like Antigravity CLI, Claude Code, Codex, eza, ls --hyperlink, rg --hyperlink-format) directly in your active VS Code Remote-SSH / Dev Containers / WSL window.
Why?
In VS Code Remote-SSH, clicking an OSC 8 file:///remote/path hyperlink bypasses VS Code's remote path resolver and passes the file:// URI straight to your local OS (microsoft/vscode#242371, anthropics/claude-code#18717), causing:
An error occurred opening an external program. No application found to open URL
This extension solves the issue cleanly in two parts:
- UI-side VS Code Extension (
extensionKind: ["ui"]) registers a URI handler (vscode://junyezhang.remote-file-opener/open?...) that resolves the active window's remote authority using only stable VS Code APIs, checks file vs. directory via vscode.workspace.fs.stat, and opens the remote target directly in the current window (with line/column range selection support).
- Zero-dependency Python PTY Wrapper (
resources/osc8-vscode-wrap.py) transparently rewrites OSC 8 file://... links on the remote host only when running inside VS Code's integrated terminal (TERM_PROGRAM=vscode or VSCODE_IPC_HOOK_CLI). Other terminals like Zed, Warp, iTerm2, or Ghostty are completely unaffected.
Quick Start
1. Install the VS Code Extension
Install Remote File URI Opener from the VS Code Marketplace or Open VSX (also works in VS Code Insiders, Cursor, Windsurf, and VSCodium), or install the .vsix locally via code --install-extension.
2. Set up the Remote Terminal Wrapper
In your VS Code Remote-SSH window:
- Open the Command Palette (
Cmd+Shift+P / Ctrl+Shift+P).
- Run
Remote File Opener: Install / Copy Remote Terminal Wrapper....
- Pick the CLI tools you want to wrap (e.g.
agy, claude, codex, eza, rg, or Custom command(s)... for tools like aider, fd, ls) and click Run in Active Terminal (or paste the copied command into your remote shell).
- Open a new VS Code integrated terminal (or run
source ~/.zshrc / source ~/.bashrc).
3. Click Any Link
Cmd+Click (macOS) or Ctrl+Click (Windows/Linux) on any OSC 8 file link in the terminal.
- On the first click, VS Code asks for one-time permission to let this extension handle URIs — check "Do not ask me again for this extension" and click Open.
vscode://junyezhang.remote-file-opener/open?path=/path/to/file.md&fragment=L10-L20
vscode://junyezhang.remote-file-opener/open?uri=file%3A%2f%2f%2fpath%2fto%2ffile.py%3A42%3A5
Extension Settings
| Setting |
Default |
Description |
remoteFileOpener.openFolderBehavior |
revealInExplorer |
Behavior when opening a directory outside the current workspace (revealInExplorer, openNewWindow, ask). |
remoteFileOpener.defaultSshHost |
"" |
Optional fallback SSH host alias when opening a link in an empty remote window or local window. |
remoteFileOpener.allowLocalWindow |
false |
Allow opening local files when triggered in a non-remote window without a target host. |
Uninstall Remote Wrapper
To remove the remote wrapper from a server, delete the wrapper directory and remove the 3-line osc8-vscode-wrapper/bin block from your ~/.zshrc or ~/.bashrc:
rm -rf ~/.local/share/osc8-vscode-wrapper
Development & Testing
npm run test:all
npm run package
Logs are available in VS Code under Output → Remote File Opener.
License
MIT