Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Remote File URI OpenerNew to Visual Studio Code? Get it now.
Remote File URI Opener

Remote File URI Opener

junye zhang

| (0) | Free
Open remote OSC 8 file:/// terminal hyperlinks directly in the active VS Code Remote-SSH, Dev Containers, or WSL window.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

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:

  1. 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).
  2. 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:

  1. Open the Command Palette (Cmd+Shift+P / Ctrl+Shift+P).
  2. Run Remote File Opener: Install / Copy Remote Terminal Wrapper....
  3. 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).
  4. 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.

Supported URI Formats

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
  • Query parameters:

    • b64: Base64url-encoded JSON payload used by the bundled PTY wrapper (lossless for paths containing +, &, #, %, spaces, and UTF-8 characters)
    • uri: Full file:///... URI (supports #L10, #L10-L20, #L10C5-L20C8, :line:col, :line:col-endLine:endCol)
    • path: POSIX file/directory path (alternative to uri)
    • fragment: Line/range fragment (e.g. L10-L20)
    • line, col (column), endLine, endCol: Explicit 1-based overrides
    • home: Remote $HOME for expanding ~/ or /~/
    • cwd: Remote working directory for resolving relative paths
    • host / authority: Optional target SSH host alias or full VS Code remote authority (e.g. ssh-remote+my-host)
  • Wrapper environment variables (optional):

    • OSC8_VSCODE_SCHEME: Override URI scheme (auto-detects vscode, vscode-insiders, cursor, windsurf, vscodium)
    • OSC8_VSCODE_EXT_ID: Override extension ID (default: junyezhang.remote-file-opener)
    • OSC8_VSCODE_SSH_HOST: Force a specific SSH host alias
    • OSC8_VSCODE_WRAP_DISABLE=1: Temporarily disable wrapping

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

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft