wslutilities / wslu

A collection of utilities for Windows Subsystem for Linux
https://wslutiliti.es/wslu
GNU General Public License v3.0
3.44k stars 155 forks source link

can't open website with wslview #263

Closed 1NC4NDESCENCE closed 1 year ago

1NC4NDESCENCE commented 1 year ago

Windows Version

Windows 10

Windows Build Number

19044

WSL Version

WSL 2

Distro Version

Ubuntu 20.04

WSL Utilities Version

2.3.6

Describe the bug

when I run wslview https://www.google.com, it reports that /usr/bin/wslview: line 108: rootc/Windows/System32/reg.exe: No such file or directory /usr/bin/wslview: line 98: rootc/Windows/System32/chcp.com: No such file or directory /usr/bin/wslview: line 103: rootc/Windows/System32/WindowsPowerShell/v1.0/powershell.exe: No such file or directory /usr/bin/wslview: line 98: rootc/Windows/System32/chcp.com: No such file or directory . But I checked and these files all exist.

Steps to Reproduce

open wsl in windows terminal type in wslview [any url] run the command

Expected behavior

I think my default browser should pop up and show me the webpage I asked for.

Additional context

No response

Code of Conduct

patrick330602 commented 1 year ago

You are using an extremely old version of wslu. Please use this PPA for the latest version: https://launchpad.net/~wslutilities/+archive/ubuntu/wslu

sim590 commented 1 year ago

I'm having trouble opening an URL also. The only way I managed to do so is to use the -E flag with powershell parameter:

wslview -E powershell some_url_here

Values cmd and cmd_explorer both didn't work. I understand that it wouldn't work with Explorer I guess, but I don't know why cmd didn't work also. Anyway, I managed to get it working.

However, I would have assumed that giving no flag would have worked by default?

FYI, I cloned the repository and issued sudo make PREFIX=/usr/local install so I'm up to date. I use a WSL/Debian image.

equiman commented 1 year ago

It works if you add the protocol

image

I have this url validation on my bash:

if [ -n "${url}" ]; then
    pattern="^(http|https)://"
    if (! [[ "${url}" =~ ${pattern} ]]); then
        url="https://${url}"
    fi
    address="${url}"
fi
patrick330602 commented 1 year ago

Closed as stale issue