Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opening VS Code with URLs doesn't work with \\wsl$ urls #99691

Closed
sarim opened this issue Jun 9, 2020 · 6 comments
Closed

Opening VS Code with URLs doesn't work with \\wsl$ urls #99691

sarim opened this issue Jun 9, 2020 · 6 comments
Assignees

Comments

@sarim
Copy link

sarim commented Jun 9, 2020

Issue Type: Bug

vscode://file///wsl$/Ubuntu-18.04/home
vscode://file/\wsl$/Ubuntu-18.04/home

Both shows a error with \wsl$\Ubuntu-18.04\home does not seem to exist anymore on disk.

vscode://file////wsl$/Ubuntu-18.04/home
vscode://file/////wsl$/Ubuntu-18.04/home
vscode://file//////wsl$/Ubuntu-18.04/home
vscode://file/\\wsl$/Ubuntu-18.04/home
vscode://file/\\wsl$/Ubuntu-18.04/home
vscode://file/\\\wsl$/Ubuntu-18.04/home

Nothing happens for these ^

VS Code version: Code 1.45.1 (5763d90, 2020-05-14T08:27:35.169Z)
OS version: Windows_NT x64 10.0.19041
Remote OS version: Linux x64 4.19.104-microsoft-standard

System Info
Item Value
CPUs Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz (4 x 3392)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 23.96GB (13.54GB free)
Process Argv --folder-uri=vscode-remote://wsl+Ubuntu-18.04/home/gittu/sploy --remote=wsl+Ubuntu-18.04
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu-18.04
OS Linux x64 4.19.104-microsoft-standard
CPUs Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz (4 x 3392)
Memory (System) 18.73GB (16.51GB free)
VM 0%
Extensions (15)
Extension Author (truncated) Version
php-intellisense fel 2.3.14
php-cs-fixer jun 0.1.154
php-namespace-resolver Meh 1.1.8
bracket-pair-colorizer Coe 1.0.61
systemd-unit-file coo 1.0.6
autoconf mae 0.1.0
dotenv mik 1.0.1
remote-containers ms- 0.117.1
remote-ssh ms- 0.51.0
remote-ssh-edit ms- 0.51.0
remote-wsl ms- 0.44.2
vscode-remote-extensionpack ms- 0.20.0
devicetree plo 0.1.1
vscode-nginx sha 0.6.0
twig wha 1.0.2
@PogoRollo
Copy link

PogoRollo commented Jun 9, 2020

vscode-remote://wsl+ for WSL.
So give vscode-remote://wsl+Ubuntu-18.04/home a try.

Edit:
Never mind, I misunderstood the bug report.
Opening a WSL folder locally (not via the remote extension) as a network drive is impossible via the vscode:// association. It seems like this is a bug in the vscode:// association.
Because opening the folder in other means is working as expected. i.e.: File > Open Folder > \\wsl$\Ubuntu-18.04\home.
Seems like the vscode:// association is treating the 2 backward slashes as escaping, or simply removing them (making them a single backward slash) and thus making the path invalid.
Any other method like \\\\ does nothing like you mentioned.
As far as I can tell, this is indeed a bug.

@aeschli
Copy link
Contributor

aeschli commented Jun 26, 2020

@sarim How exactly do you use the vscode://file/\\\wsl$/Ubuntu-18.04/home URIs?

@sarim
Copy link
Author

sarim commented Jun 26, 2020

Sorry I didn't update this issue. But eventually I got it to work. Not sure if vscode updates (now I'm at 1.46.1) fixed it. I'm running symfony projects inside wsl2, and coding via VSCode remote. Symfony in its debug generates links to exact file and line for error / warning / emitted events etc...
Like this.

<a href="vscode://file//wsl$/Ubuntu-18.04/home/gittu/sploy/vendor/easycorp/easyadmin-bundle/src/Controller/AdminControllerTrait.php:63:0" title="App\Controller\Admin\DeployController">DeployController :: indexAction</a>

Symfony gets the pattern for generating the URL from a config value.

$ cat /etc/php/7.2/mods-available/xdebug.ini
zend_extension=xdebug.so
xdebug.file_link_format="vscode://file//wsl$/Ubuntu-18.04%f:%l:0"

With this now it works. Though it always opens the file in a new window (where I want it to open it inside the project window) but for now I can live with it.

@aeschli aeschli closed this as completed Jun 29, 2020
@aeschli
Copy link
Contributor

aeschli commented Jun 29, 2020

Thanks, I'm closing the issue then.

@hcoat
Copy link

hcoat commented Aug 8, 2020

I am hoping this issue could have another look.

While URLs like vscode://file/$wsl/distro/path/to/file:18 will open the file in a new local window and not a remote-wsl window or project.
This is problematic because the extensions and settings are not the same for local and remote-wsl connections, making the new window unusable for me.

wsl$ URLs really needs to be opened in the currently open remote-wsl project to be useful.

@aeschli
Copy link
Contributor

aeschli commented Aug 12, 2020

@hcoat To open a remote window, don't use file but vscode-remote. Please try
vscode://vscode-remote/wsl+distro/path/to/file

@github-actions github-actions bot locked and limited conversation to collaborators Aug 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants