Skip to content

Fix codespace code command under WSL#4747

Merged
mislav merged 2 commits intotrunkfrom
vscode-wsl
Nov 24, 2021
Merged

Fix codespace code command under WSL#4747
mislav merged 2 commits intotrunkfrom
vscode-wsl

Conversation

@mislav
Copy link
Contributor

@mislav mislav commented Nov 17, 2021

The codespace code command used the skratchdot/open-golang library to open vscode:// URLs, which uses xdg-open for Linux under the hood, which isn't available under WSL.

This switches over to using the cli/browser package which has explicit support for WSL by invoking wslview when found. Note that the user's web browser should never actually open, even though we invoke the browser.Browse(url) method. Instead, the OS should immediately handle vscode:// URLs by opening VS Code directly.

Fixes #4709 /cc @mattKorwel

The `codespace code` command used the `skratchdot/open-golang` library
to open `vscode://` URLs, which uses `xdg-open` for Linux under the
hood, which isn't available under WSL.

This switches over to using the `cli/browser` package which has explicit
support for WSL by invoking `wslview` when found.
@mislav mislav requested review from a team as code owners November 17, 2021 16:02
@mislav mislav requested review from vilmibm and removed request for a team November 17, 2021 16:02
@mislav mislav enabled auto-merge (squash) November 24, 2021 16:11
@mislav mislav merged commit a573eb5 into trunk Nov 24, 2021
@mislav mislav deleted the vscode-wsl branch November 24, 2021 16:18
despreston pushed a commit to despreston/cli that referenced this pull request Nov 24, 2021
The `codespace code` command used the `skratchdot/open-golang` library
to open `vscode://` URLs, which uses `xdg-open` for Linux under the
hood, which isn't available under WSL.

This switches over to using the `cli/browser` package which has explicit
support for WSL by invoking `wslview` when found.
@VictorBatta VictorBatta mentioned this pull request Dec 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add WSL support to codespace code command

3 participants