-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slow prompt command (oh-my-zsh) #1
Comments
Since writing that post I've pretty much completely abandoned WSL and have fully switched to Arch for the past year. However, I do remember that my setup was a bit slow as well. I assume this has to do with What I would recommend, is to remove and reinstall zsh and oh-my-zsh. This time fully abandon antigen, as it's not developed anymore. I probably had a reason for using at the time but don't anymore! Oh-my-zsh has an easy plugin syntax now:
I also remember The rest of the setup should be irrelevant to the startup time. But again for your info, VSCode is a fantastic CPP development environment. Moreover, it has great integration for the development of CPP using WSL in a *nix environment where you run and debug from WSL but interface and code on Windows using VSCode. So I would abandon vim and investigates this as well. Good luck with 4400 |
This is my entire .zshrc now:
|
Hello, I have the same issue. After update to WLS 2 the ZSH and GIT are slowing things down to a point where I wait 10s before I can |
Scott Hanselman comments on this problem in the article below
See the GOTCHA towards the end of the article: https://www.hanselman.com/blog/HowToMakeAPrettyPromptInWindowsTerminalWithPowerlineNerdFontsCascadiaCodeWSLAndOhmyposh.aspx |
same issue with @mp3por |
I found a simple solution.
|
I had this same issue when using |
I copied over my code directory into my linux home directory and it is blazing fast now! I was able to re-enable all of my git prompts! The copy took forrrrevvvver, but once that was done all git actions, git prompts, and tab completes are super quick now. Here's the screenshot of the note mentioned in the comment above: |
There's another gotcha. WSL automatically adds stuff to PATH pointing to windows directories. This can bring auto complete to a hold. Solution: disabling this part of auto complete or disabling PATH modification by WSL. |
Root cause is WSL using the slow 9P protocol to access Windows drive. |
This is what solved my problem. |
@scardenasb |
I disabled the git prompt in /mnt directory and it works.
|
I came here for the same issue and I quickly realized it was the git stuff sloing everything down. Was jsut wondering if anyone would have any ideas on how I could make it use the windows git.exe for this stuff instead when on an ntfs drive. eg.
ideas on how this could work? |
@b-hayes & @Lucas-Ten I overrode the function implementation after OhMyZsh was loaded. It looks as follows: oh-my-zsh-git-patch.sh __git_prompt_git() {
if wslpath -w . | grep -q '\\wsl'; then
echo git $@
else
echo powershell.exe git.exe --no-optional-locks $@
fi
} In my .zshrc: # After:
source $ZSH/oh-my-zsh.sh
# Insert:
export MICROSOFT_UNAME=$(uname -a | grep -i microsoft)
export IS_WSL=$( [ ! -z "$MICROSOFT_UNAME" ] && echo "1" || echo "0" )
if [[ "$IS_WSL" == "1" ]]; then
source $PERSONAL_SHELL_SETUP_PATH/wsl/oh-my-zsh-git-patch.sh
fi Alternative: Use the original script instead, but create an alias called git instead. (With the same implementation as above). this way, all other tools would access the windows git version, too (including vscode). You can also see the fix integrated in my shell-setup repo here: Hobart2967/shell-setup@291fcb5 |
@Hobart2967 Using your prompt I get the following result displayed:
I did end up creating an alias to my own script tho and that seems to work well.
|
My current setup source $ZSH/oh-my-zsh.sh
export MICROSOFT_UNAME=$(uname -a | grep -i microsoft)
export IS_WSL=$( [ ! -z "$MICROSOFT_UNAME" ] && echo "1" || echo "0" )
if [[ "$IS_WSL" == "1" ]]; then
__git_prompt_git() {
if wslpath -w . | grep -q '\\wsl'; then
git --no-optional-locks $@
else
git.exe --no-optional-locks $@
fi
}
fi
|
Another way to solve this issue is to choose a zsh theme that doesn't use the git plug-in. $ cd ~/.oh-my-zsh/themes
$ grep --files-without-match "git" *
cypher.zsh-theme
duellj.zsh-theme
evan.zsh-theme
funky.zsh-theme
imajes.zsh-theme
jtriley.zsh-theme
mikeh.zsh-theme
random.zsh-theme
rkj.zsh-theme
xiong-chiamiov.zsh-theme |
I followed your instructions but I ended up a very slow command prompt from Zsh. It takes almost a second for the prompt to show again. Is there a way to make it faster?
The text was updated successfully, but these errors were encountered: