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
Very Slow on WSL 2 #1038
Comments
Does this issue occur in all paths or just ones with git repos? We've been getting a number of reports of slow performance of starship in git repos even not in WSL2, but if this occurs outside of git repos then it's probably an unrelated issue. |
@chipbuster Thanks for the reply. I can provide some additional (and related) findings but there's some more digging I would like to do on WSL2. Once that's done I will report back. So last night I switched back to WSL 1 and did some testing, and I had the following findings:
I am going to switch back to WSL 2, do some more testing and report back. |
Hah, I think I spotted the pattern here! In WSL 2, when the current directory is in the Windows I will file an issue in WSL's repo, or link a similar issue if I found one. Update: Related discussion microsoft/WSL#4197 |
I will close this for now as the problem is mostly on the WSL 2 side. |
I believe this has to do with how WSL 2 optimizes FS access between the virtual Linux disk and the Windows physical disk:
|
@pizzafox try this. It may shed some light on how to make Starship correctly within WSL2. This is how my Zsh terminal currently looks like: These are the prompts I use:
One of the most useful features in my opinion is git tab completion. It even detects branch names and auto complete them on tab. This works best on Zsh. But it would be nice to see the same functionality in Starship regardless if using Zsh prompt or any other. |
To be honest I don't know if I should post the issue here or on WSL's repo but considering a vanilla zsh does not have this problem I will post the issue here first.
Current Behavior
zsh with starship is super slow on WSL2. For example, after hitting Enter, I need to wait for 5 to 20 seconds before the new prompt appears.
Expected Behavior
Adding starship prompt should not hinder performance this much.
Additional context/Screenshots
Oh-my-zsh has a similar if not worse performance issue. (I was using the spaceship theme.)
This performance issue is not that bad if the current directory does not contain a lot of files.
zsh without starship:
zsh with starship
Environment
Relevant Shell Configuration
Starship Configuration
The text was updated successfully, but these errors were encountered: