4

I used tcsh for decades on cygwin and just started using git-bash on my new Windows PC. It's generally a step up but the time from when the last command finishes until I receive the next command prompt is abysmal, like almost one second. I did a slo-mo video of hitting Enter five times and found that it was 950 ms to show each command prompt. Yikes! For comparison, cmd and cygwin+tcsh+mintty are well under 50 ms.

So what is causing this? Is there anything I can do about it?

This is a little bit jarring at times and knocks me out of my groove. But the bigger issue is that it seems to screw up my typing ahead. If I can finish typing the whole next command and press enter before it finishes making the command prompt then it seems to capture it all correctly, but if it finishes prompting while I'm in the middle of typing then it often discards everything I've typed so far. That is super annoying. Are others seeing that?

$ bash --version
GNU bash, version 4.4.23(1)-release (x86_64-pc-msys)
$ git --version
git version 2.30.1.windows.1
$ declare -p PS1
declare -x PS1="\\[\\033]0;\$TITLEPREFIX:\$PWD\\007\\]\\n\\[\\033[32m\\]\\u@\\h \\[\\033[35m\\]\$MSYSTEM \\[\\033[33m\\]\\w\\[\\033[36m\\]\`__git_ps1\`\\[\\033[0m\\]\\n\$ "
$ declare -p PROMPT_COMMAND
bash: declare: PROMPT_COMMAND: not found
2
  • This is probably some program on your computer that is causing stuff to interfere with processes starting or exiting. Are you using an antivirus other than Windows Defender or any sort of monitoring software on your computer?
    – bk2204
    Apr 1, 2021 at 0:51
  • what does __git_ps1 do? and how long does it take to run?
    – cas
    Apr 4, 2021 at 0:57

2 Answers 2

1

This happens when you add a network location in your PATH environment variable for example ~/bin. If you are having OneDrive installed "~" maps to One drive location. Which takes a long time to enumerate.

0

This may help, if you've experienced the same issue I have.

Brand new Windows 10 Pro PC, fully loaded, all M.2 drives, 64GB 6000 Hz RAM 13th gen. Git bash running extremely slow, taking 10-20 seconds for every prompt. Nothing fixed it. Not reboots, not changing the prompt setting, nothing.

It seems to be related to the page file. The first instance of slowdown I had reduced page file to minimums, not wanting to utilize too much SSD lifespan.

Once I set page file back to system managed, git bash is blazing fast again. A couple weeks later it slowed down again, the same way. Again nothing fixed it, multiple reboots, nothing.. I turned off page file (rebooted), turned it back to system managed (rebooted), and it's back to blazing fast again.

It could be coincidental. But I hope it helps someone. This was a very frustrating issue.

1
  • 1
    Welcome to the site, and thank you for your contribution. Please note that in order for this answer to be as helpful as possible to others, you may want to include the commands you had to use in order to perform these settings.
    – AdminBee
    Feb 9, 2023 at 12:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .