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

WSL bug: url hash params cut-off #20

Closed
tfiers opened this issue Jan 28, 2023 · 1 comment
Closed

WSL bug: url hash params cut-off #20

tfiers opened this issue Jan 28, 2023 · 1 comment

Comments

@tfiers
Copy link
Contributor

tfiers commented Jan 28, 2023

In WSL,

DefaultApplication.open("https://google.com/#Blah")

opens just https://google.com in the browser.
(On Windows, it does the correct thing)

Strangely, if you do

run(`powershell.exe -NoProfile -NonInteractive -Command start '"https://google.com/#Blah"'`, wait=false)

(which seems to be what DefaultApplication does in WSL),
then it does work correctly!

i.e. here, the first command opens https://google.com in my (Windows) browser, while the second opens https://google.com/#Blah:
image


For context, my use case:

@tfiers
Copy link
Contributor Author

tfiers commented Jan 28, 2023

Oh ok, comparing the output in the screenshot I see the problem: relpath in the below deletes one of the slashes in https://:

elseif _is_wsl
# Powershell can open *relative* paths in WSL, hence using relpath
# Could use wslview instead, but powershell is more universally available.
# Could use cmd + wslpath instead, but cmd complains about the working directory.
# Quotes around the filename are to deal with spaces.
relfile = relpath(filename)
cmd = `powershell.exe -NoProfile -NonInteractive -Command start \"$(relfile)\"`

julia> relpath("https://google.com/#Blah")
"https:/google.com/#Blah"

(tbf, URLS are a non-documented feature, re #12)

tfiers added a commit to tfiers/DefaultApplication.jl that referenced this issue Jan 28, 2023
tfiers added a commit to tfiers/DefaultApplication.jl that referenced this issue Jan 28, 2023
better than nothing at all, no
@tpapp tpapp closed this as completed in 14df0ff Feb 9, 2023
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

No branches or pull requests

1 participant