0

When using man in Linux, many commands list URLs, which in some terminals like gnome-terminal or terminator are clickable.

For example, man ls shows:

A clickable URL when hovering over with the mouse

Which allows to click on http://www.gnu.org/software/coreutils.

Clicking on it in Gnome terminator under WSL makes it hung.
And shows this output in the terminal that started terminator:

etomort@ES-00002604:/mnt/c/Users/etomort
$ /usr/bin/xdg-open: 782: /usr/bin/xdg-open: : Permission denied
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: x-www-browser: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: firefox: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: iceweasel: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: seamonkey: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: mozilla: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: epiphany: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: konqueror: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: chromium: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: chromium-browser: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: google-chrome: not found


[1]+  Stopped                 terminator  (wd: ~)
(wd now: /mnt/c/Users/etomort)
[2]   Done                    terminator

Is there a way to make xdg-open in WSL to call a Windows exe program?

Note: this question is related but more specific.
And the only answer is not useful for this purpose.

nephewtom
  • 2,941
  • 3
  • 35
  • 49

2 Answers2

3

I ran into the same issue with Hashicorp Vault in WSL.

I created a script that basically forwards xdg-open to powershell -c start

Not tested much though.

sudo tee /usr/local/bin/xdg-open <<EOF
#!/bin/sh

powershell.exe -c start "'\$@'"
EOF
sudo chmod +x /usr/local/bin/xdg-open

Cheers Oliver

0

Try using wslview instead of xdg-open, it works in Windows 10 wsl.

Install with:

sudo apt install wslu

source: https://manpages.ubuntu.com/manpages/impish/man1/wslview.1.html

jawira
  • 3,668
  • 2
  • 17
  • 27