Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>RemotePathMapNew to Visual Studio Code? Get it now.
RemotePathMap

RemotePathMap

easyatm

|
6 installs
| (0) | Free
Map remote SSH workspace paths to local folders and reveal the mapped location from Explorer.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

RemotePathMap

中文说明(点击展开)

RemotePathMap 是一个运行在本地 UI 侧的 VS Code 扩展,用于在远程 SSH 开发时,把远程工作区路径映射到本地目录,并从资源管理器右键直接定位到映射后的本地文件或文件夹。

解决的问题

在 Remote SSH 窗口里,资源管理器右键的“在文件资源管理中显示”通常无法直接定位到本机文件系统。如果你已经把远程项目同步、挂载或映射到了本地目录,这个扩展可以在右键菜单里补上一条可用的本地定位入口。

工作方式

  • 扩展声明为 UI 扩展,运行在本地。
  • 扩展仅通过命令触发激活,不会因为打开 WSL 或其他 vscode-remote 文件系统而自动激活。
  • 仅在 Remote SSH 窗口中对 SSH 远程资源显示右键菜单项;WSL 窗口不显示这些菜单项。
  • 资源管理器右键菜单和文件标签页右键菜单都会显示命令。
  • 通过远程资源的 authority 和远程工作区根路径建立映射。
  • 当映射结果是具体文件时,Windows 和 macOS 会尽量在系统文件管理器中选中文件名;如果是目录,则直接打开该目录。
  • 尚未配置映射或没有匹配映射时,命令会提示打开映射设置。

配置项

全局映射:remotePathMap.globalMappings

本机用户设置中的全局映射,适合同一远程 authority 和远程根路径在多个工作区重复使用的场景。

映射结构

{
  "ssh-remote+dev-server/srv/project": "D:\\mirror\\project",
  "192.168.1.8/": "P:\\"
}

说明:VS Code 对 Remote SSH 连接稳定暴露的是 authority,例如 ssh-remote+主机别名。它不一定能提供原始 IP,因此全局映射采用 authority + 远程工作区根路径作为匹配键。键名也支持只写主机名或 IP,例如 192.168.1.8/。

本地路径选择说明

在 remotePathMap.globalMappings 中配置本地根路径时,请填写本机系统可访问的绝对路径。远程根路径可以是当前工作区文件夹、某个子目录,或整个远程根目录 /。

调试

  1. 执行 npm install。
  2. 按 F5,选择“运行 RemotePathMap 扩展”。
  3. 在新的扩展开发宿主窗口里打开一个 Remote SSH 工作区进行验证。WSL 工作区不应显示右键菜单项。

测试

执行 npm test 可以运行路径映射相关的单元测试。

打包与发布

  • 执行 npm run package:extension 生成 VSIX 安装包。
  • 执行 npm run publish:extension 发布扩展到 Marketplace。

RemotePathMap is a VS Code UI extension that runs locally. It maps Remote SSH workspace paths to local folders and lets you reveal the mapped local file or folder from Explorer.

Problem Solved

In Remote SSH windows, the built-in Reveal in File Explorer action often cannot locate the corresponding path on the local machine. If you already mirror, mount, or sync the remote project to a local directory, this extension adds a usable Explorer context action for that local path.

How It Works

  • The extension runs as a UI extension on the local side.
  • The extension activates only when one of its commands is invoked, not merely because WSL or another vscode-remote file system is opened.
  • Explorer context menu entries appear only for Remote SSH resources. They are hidden in WSL windows.
  • The command is available from both Explorer context menus and editor tab context menus.
  • Mappings are matched by remote authority plus remote workspace root path.
  • When the mapped target is a file, Windows and macOS try to reveal and select the file in the system file manager; when it is a directory, the directory is opened directly.
  • When no mapping is configured or no mapping matches, the command prompts you to open the mapping setting.

Settings

Global Mappings: remotePathMap.globalMappings

Mappings stored in local user settings on this machine. Use this when the same remote authority and remote root should be reused across multiple workspaces.

Mapping Shape

{
  "ssh-remote+dev-server/srv/project": "D:\\mirror\\project",
  "192.168.1.8/": "P:\\"
}

VS Code reliably exposes the Remote SSH authority, for example ssh-remote+host-alias. It does not always expose the raw IP, so global mappings use authority plus remote workspace root as the matching key. The key may also use a bare host name or IP, for example 192.168.1.8/.

Local Path Selection

When configuring remotePathMap.globalMappings, use an absolute path that is accessible on the local machine. The remote root may be the current workspace folder, a subdirectory, or the entire remote root such as /.

Debugging

  1. Run npm install.
  2. Press F5 and choose 运行 RemotePathMap 扩展.
  3. In the Extension Development Host window, open a Remote SSH workspace and verify the Explorer context menu flow. WSL windows should not show the context menu entries.

Testing

Run npm test to execute the path mapping unit tests.

Packaging And Publishing

  • Run npm run package:extension to generate a VSIX package.
  • Run npm run publish:extension to publish the extension to the Marketplace.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft