Skip to content

Commit

Permalink
feat(wsl): 🐛 Fix git integration of Oh My Zsh being way too slow unde…
Browse files Browse the repository at this point in the history
…r WSL2
  • Loading branch information
Hobart2967 committed Jun 27, 2023
1 parent ba751f2 commit 291fcb5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Expand Up @@ -9,6 +9,7 @@
"asdf-vm",
"nvm",
"python",
"common"
"common",
"wsl"
]
}
9 changes: 5 additions & 4 deletions _index.sh
Expand Up @@ -9,6 +9,9 @@
################################################################
alias boot=echo ""

export MICROSOFT_UNAME=$(uname -a | grep -i microsoft)
export IS_WSL=$( [ ! -z "$MICROSOFT_UNAME" ] && echo "1" || echo "0" )

source $PERSONAL_SHELL_SETUP_PATH/utilities/_colors.sh
source $PERSONAL_SHELL_SETUP_PATH/utilities/greet.sh

Expand Down Expand Up @@ -50,10 +53,8 @@ source $PERSONAL_SHELL_SETUP_PATH/tools/wake-on-lan.sh
printf "pipx Extensions..."
source $PERSONAL_SHELL_SETUP_PATH/pipx/pipx-path-helper.sh

if [[ "$OSTYPE" == "win32" ]]; then
if grep -qi microsoft /proc/version; then
source $PERSONAL_SHELL_SETUP_PATH/wsl/xdg-open-fix.sh
fi
if [[ "$IS_WSL" == "1" ]]; then
source $PERSONAL_SHELL_SETUP_PATH/wsl/xdg-open-fix.sh
fi

CLEANED_OSTYPE="${OSTYPE:0:6}"
Expand Down
3 changes: 3 additions & 0 deletions _patches.sh
@@ -0,0 +1,3 @@
if [[ "$IS_WSL" == "1" ]]; then
source $PERSONAL_SHELL_SETUP_PATH/wsl/oh-my-zsh-git-patch.sh
fi
7 changes: 7 additions & 0 deletions wsl/oh-my-zsh-git-patch.sh
@@ -0,0 +1,7 @@
__git_prompt_git() {
if wslpath -w . | grep -q '\\wsl'; then
echo git $@
else
echo powershell.exe git.exe --no-optional-locks $@
fi
}

0 comments on commit 291fcb5

Please sign in to comment.