Closed zbouslikhin closed 2 years ago
@zbouslikhin this can't be resolved by oh-my-posh but is something the repo needs to address. You can try the following to make the repo more performant:
Is there a way to disable fetch_status
conditionally based on the current directory? (Using .envrc or something like that)
@haizaar sure, you can use the ignore_status
property to exclude fetching status in certain repositories. See here.
Thank you for the quick response! Can I set this conditionally based on an environment variable? I'd rather keep the knowledge of a git directory being too big inside the directory itself and signal OMP about it using a env var with the help of direnv
@haizaar no, we don't really have that functionality. It's config based today.
Got'ya.
Eventually I've created two copies of my theme - one with fetch_status: false
. On large repos I use direnv's .envrc
to export POSH_THEME
to point to the no-status one. A bit hacky but works fine.
Have you considered fetching git status as a background async process? - powerlevel10k does it this way and it works great, i.e. prompt appears immediately with the git status being populated (a bit) later.
@haizaar I did consider that, but that would require a completely separate service. I studied powerlevel10k's implementation but it's not worth my while as it's definitely not a simple background service. I'd argue git needs to become more efficient. Although recent improvements to fsmonitor do improve things out of the box when enabled.
Goty'a. I hope fsmonitor lands on Linux one day.
@haizaar wasn't it built-in as of late?
❯ git fsmonitor--daemon
fatal: fsmonitor--daemon not supported on this platform
I can't find any reference for it working on linux :(
@haizaar are you using NixOS?
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. If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.
Code of Conduct
What happened?
Hello,
As the project (therefore repo) that I'm working on is getting bigger and bigger, I have noticed lately that each time a command is run, it takes 2-10s to run it.
After investigating I came to the conclusion that the problem is because of enabling "fetch_status". As soon as I disable it, everything runs smoothly.
Theme
Unicorn, but happens in all themes if fetch_status is enable
What OS are you seeing the problem on?
Windows, Linux
Which shell are you using?
No response
Log output