Skip to content

Commit f2da2c5

Browse files
committed
Add support for invoking from WSL shell
1 parent 6495b09 commit f2da2c5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

git-it-on.plugin.zsh

+9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
#!/bin/zsh
2+
IN_WSL=false
3+
if [ -n "$WSL_DISTRO_NAME" ]; then
4+
IN_WSL=true
5+
elif [[ $(uname -a | grep -i 'Microsoft') ]]; then
6+
IN_WSL=true
7+
fi
8+
29
__open() {
310
if [ "$(uname -s)" = "Darwin" ]; then
411
open "$1" 2> /dev/null
12+
elif if $IN_WSL; then
13+
cmd.exe /c "start $1"
514
else
615
xdg-open "$1" &> /dev/null
716
fi

0 commit comments

Comments
 (0)