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
Preview in browser fails in WSL with: exec: "xdg-open": executable file not found in $PATH #826
Comments
Ouch, sorry for that. We should try to save your PR title & body on failure so you can reuse those on next retry.
Thanks for sharing that! We will try to detect and use that in the future. Until then, you can set |
Awesome, thanks! I'll enable |
For me, it opens at EDIT: Followed comment in #597 and its working now! |
This is my tiny hack for use these two tweaks for the best experience on WSL.
|
@jetersen Thanks, but this seems like more steps than just setting |
No I suggest both fixes to have the most success with compatibility. I still use I put my |
@jetersen Ah I see now that you were not solving this issue just for |
I take a similar approach as @jetersen, but easier: sudo ln -s $(which wslview) /usr/local/bin/xdg-open Just run and you should be good to go. |
@felipecassiors good point, I did not think of symlinking. |
Thx @jetersen you saved me! , fandme verdensklasse |
Describe the bug
The
Preview in Browser
option for a new pull request (viagh pr create
) fails with the following error when used in WSL (I'm using the Pengwin distro on WSL2):As a result, you lose the PR body you've typed into the editor and have to start the PR creation process again.
Steps to reproduce the behavior
gh pr create
Preview in Browser
optionExpected vs actual behavior
This error is thrown and the command exits, losing all information:
Ideally it should open the browser on the host to preview the PR, as if it was run on the host directly.
wslview
is included with most WSL distros and can be used to open the browser in Windows 10. More information: https://github.com/wslutilities/wsluThe alternative would be to provide the user the option to submit the PR directly or display a URL to manually paste into the browser for the preview.
Logs
The text was updated successfully, but these errors were encountered: