WSL Path Copier
Copy a file or folder open through Remote - WSL as a Windows path.
This converts in the WSL → Windows direction, so you can paste the path into Windows apps such as File Explorer. Many other extensions convert the other way, from Windows paths to /mnt/c/....
Use
- In the Explorer, right-click a file or folder and select WSL Path: Copy Windows Path. If several items are selected, all of their paths are copied, one per line.
- With an editor open, run WSL Path: Copy Windows Path from the Command Palette.
No keybinding is assigned by default. To add one, open Preferences: Open Keyboard Shortcuts (JSON) and add an entry such as:
{
"key": "ctrl+alt+c",
"command": "vscode-wslpath.copyWindowsPath",
"when": "editorTextFocus && remoteName == wsl"
}
The extension runs wslpath -w in the WSL extension host, then copies the resulting path through the VS Code clipboard API. For example, /mnt/c/work/example becomes C:\work\example; paths in the WSL filesystem are typically copied as \\wsl.localhost\<distribution>\....
The command is shown only in a Remote - WSL window.
Development
npm install
npm run compile
Use Run Extension in VS Code to launch an Extension Development Host connected to WSL.