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
hasCommand takes over 1s #1085
Comments
@KyleBastien we've only seen this once (also with git) where the executable was mapped to something else (it picked up a shell script rather than an executable). |
@JanDeDobbeleer maybe I'm being daft here, by executable here do you meant the |
The git executable (that's the which seems to take a long time). |
@KyleBastien I'm going to add some logging so we can see what's going on. |
@KyleBastien with the latest release, can you run the debug again and share the logs? |
@JanDeDobbeleer Thanks for the help here! On v5.12.0 I see this:
Looks like maybe this error is related?
|
@KyleBastien that comes from |
@JanDeDobbeleer I have ~66 folders in PATH by the looks of it. That doesn't seem like that many? But I can see that if I move
Going to close, since this looks to be a me problem. Thank you so much for you help on this @JanDeDobbeleer! |
I only figured out this possibility by looking at go's source code. It's an interesting piece to debug as there could be quite a bit of optimizations to be done on Windows from oh-my-posh. |
@JanDeDobbeleer it might be faster (more consistently) just to exec |
@KyleBastien there was an issue with git on Windows where the command cache was't correctly set. When you run |
Ahh that makes sense. Yes I can see the advantage of just doing the current method. After moving the folder in my path and now upgrading to 5.12.1 this is basically instant now. Really appreciate your help on this @JanDeDobbeleer! |
This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. |
Code of Conduct
What happened?
oh-my-posh is quite slow on my machine (Windows). I ran the debug tool and opened the log, and it looks like
hasCommand
is possibly the culprit.Any input on why this would be the case? It's also slow on subsequent runs, even though I think
hasCommand
tries to cache this result.Version
5.10.1
Theme
aliens
What OS are you seeing the problem on?
Windows
Which shell are you using?
powershell
Relevant log output
No response
The text was updated successfully, but these errors were encountered: