Add support for WSL

This commit is contained in:
Frank Fesevur 2017-10-30 13:11:09 +01:00
parent 07d75b2e1e
commit bbb046887a

View file

@ -109,7 +109,13 @@ case $( uname -s ) in
MINGW*) open='start';;
MSYS*) open='start';;
CYGWIN*) open='cygstart';;
*) open='xdg-open';;
*) # Try to detect WSL (Windows Subsystem for Linux)
if uname -r | grep -q Microsoft; then
open='powershell.exe'
openopt='Start'
else
open='xdg-open'
fi;;
esac
# Allow printing the url if BROWSER=echo
@ -118,4 +124,4 @@ if [[ $BROWSER != "echo" ]]; then
fi
# open it in a browser
${BROWSER:-$open} "$openurl"
${BROWSER:-$open} $openopt "$openurl"