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

Use wslview to launch browser in Windows from WSL #529

Merged
merged 1 commit into from
Nov 16, 2021

Conversation

mjcheetham
Copy link
Collaborator

When installed inside of a Linux environment we typically look for a set of utilities to open the user's preferred browser (xdg-open, gnome-open, kfmclient).

However, if we are actually in a WSL (Windows Subsystem for Linux) distribution, these utilties may not be/are not present. Instead we can try and use the wslview utility that will launch the user's browser on the Windows host.

Appending wslview to the list of utilities to open the browser means no behaviour change for existing Linux users, but for WSL distros we now have a chance to still open the browser.

Fixes #515

When installed inside of a Linux environment we typically look for a set
of utilities to open the user's preferred browser (xdg-open, gnome-open,
kfmclient).

However, if we are actually in a WSL (Windows Subsystem for Linux)
distribution, these utilties may not be/are not present. Instead we can
try and use the `wslview` utility that will launch the user's browser on
the _Windows host_.

Appending `wslview` to the list of utilities to open the browser means
no behaviour change for existing Linux users, but for WSL distros we now
have a chance to still open the browser.
@mjcheetham mjcheetham added enhancement New feature or request platform:wsl Specific to Windows Subsystem for Linux labels Nov 15, 2021
@mjcheetham mjcheetham merged commit 0d360ac into git-ecosystem:main Nov 16, 2021
@mjcheetham mjcheetham deleted the wslview branch November 16, 2021 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request platform:wsl Specific to Windows Subsystem for Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support opening the default Windows browser from WSL
3 participants