File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 105
105
106
106
# get current open browser command
107
107
case $( uname -s ) in
108
- Darwin) open=' open' ;;
109
- MINGW* ) open=' start' ;;
110
- MSYS* ) open=' start' ;;
111
- CYGWIN* ) open=' cygstart' ;;
112
- * ) open=' xdg-open' ;;
108
+ Darwin) open=' open' ;;
109
+ MINGW* ) open=' start' ;;
110
+ MSYS* ) open=' start' ;;
111
+ CYGWIN* ) open=' cygstart' ;;
112
+ * ) # Try to detect WSL (Windows Subsystem for Linux)
113
+ if uname -r | grep -q Microsoft; then
114
+ open=' powershell.exe'
115
+ openopt=' Start'
116
+ else
117
+ open=' xdg-open'
118
+ fi ;;
113
119
esac
114
120
115
121
# Allow printing the url if BROWSER=echo
@@ -118,4 +124,4 @@ if [[ $BROWSER != "echo" ]]; then
118
124
fi
119
125
120
126
# open it in a browser
121
- ${BROWSER:- $open } " $openurl "
127
+ ${BROWSER:- $open } $openopt " $openurl "
You can’t perform that action at this time.
0 commit comments