Indefinite Random lag when using Git Bash #23112

Closed
opened 2026-01-31 08:32:42 +00:00 by claunia · 6 comments
Owner

Originally created by @RushilJalal on GitHub (Apr 4, 2025).

Windows Terminal version

1.22.10731.0

Windows build number

26100.3624

Other Software

Git Bash git version 2.45.2.windows.1

Steps to reproduce

This is completely random.

Expected Behavior

I expect no lags of this nature.

Actual Behavior

the cursor keeps blinking but no reflection of keyboard keystrokes.
Sometimes, after a while(10-15 seconds), all the text which was typed while the terminal was stuck, appears at the same time.

Originally created by @RushilJalal on GitHub (Apr 4, 2025). ### Windows Terminal version 1.22.10731.0 ### Windows build number 26100.3624 ### Other Software Git Bash git version 2.45.2.windows.1 ### Steps to reproduce This is completely random. ### Expected Behavior I expect no lags of this nature. ### Actual Behavior the cursor keeps blinking but no reflection of keyboard keystrokes. Sometimes, after a while(10-15 seconds), all the text which was typed while the terminal was stuck, appears at the same time.
claunia added the Needs-TriageIssue-BugNeeds-Attention labels 2026-01-31 08:32:43 +00:00
Author
Owner

@DHowett commented on GitHub (Apr 9, 2025):

Hey, that's weird!

Does this happen when you run Git Bash outside of Windows Terminal?

If you press control keys when it's stuck like this, e.g. Ctrl+C or Ctrl+Q, does anything happen/?

@DHowett commented on GitHub (Apr 9, 2025): Hey, that's weird! Does this happen when you run Git Bash _outside_ of Windows Terminal? If you press control keys when it's stuck like this, e.g. <kbd>Ctrl+C</kbd> or <kbd>Ctrl+Q</kbd>, does anything happen/?
Author
Owner

@RushilJalal commented on GitHub (Apr 10, 2025):

@DHowett No, this does not happen when running Git Bash in its own window.

Nothing happens when I press the above shortcut keys. The cursor keeps blinking and the window is completely unresponsive.

@RushilJalal commented on GitHub (Apr 10, 2025): @DHowett No, this does not happen when running Git Bash in its own window. Nothing happens when I press the above shortcut keys. The cursor keeps blinking and the window is completely unresponsive.
Author
Owner

@RushilJalal commented on GitHub (Apr 10, 2025):

I noticed this issue is reproducible when i am focused on the Windows Terminal running Git Bash and I click Tab twice.
I ensure that the window hasn't lost focus but yet it stops taking input.
Otherwise, its a random issue.

Also, it started working after 20 seconds or so.

@RushilJalal commented on GitHub (Apr 10, 2025): I noticed this issue is reproducible when i am focused on the Windows Terminal running Git Bash and I click Tab twice. I ensure that the window hasn't lost focus but yet it stops taking input. Otherwise, its a random issue. Also, it started working after 20 seconds or so.
Author
Owner

@DHowett commented on GitHub (Apr 10, 2025):

Wait a sec - you have to press tab?

This will break your existing session (so don't do it on anything you care about,) but if you set...

export PATH=/bin

and then press Tab a couple times, does it still hang?

@DHowett commented on GitHub (Apr 10, 2025): Wait a sec - you have to press tab? This will break your existing session (so don't do it on anything you care about,) but if you set... ``` export PATH=/bin ``` and then press <kbd>Tab</kbd> a couple times, does it still hang?
Author
Owner

@RushilJalal commented on GitHub (Apr 11, 2025):

Yeppp, setting the above command in the .bash-profile fixed it for now.

Although, don't you think this should be set by default?

P.S I noticed commands like npm install -g @angular/cli or any other npm command stop working and throws the error npm: Not Found after setting the above PATH.

My current .bash_profile:

export BUN_INSTALL="$HOME/.bun"
export PATH=$BUN_INSTALL/bin:$PATH
#export PATH=/bin  <- commented since other commands stop working when I use this
@RushilJalal commented on GitHub (Apr 11, 2025): Yeppp, setting the above command in the `.bash-profile` fixed it for now. Although, don't you think this should be set by default? P.S I noticed commands like `npm install -g @angular/cli` or any other `npm` command stop working and throws the error `npm: Not Found` after setting the above PATH. My current `.bash_profile`: ```bash export BUN_INSTALL="$HOME/.bun" export PATH=$BUN_INSTALL/bin:$PATH #export PATH=/bin <- commented since other commands stop working when I use this ```
Author
Owner

@DHowett commented on GitHub (Apr 14, 2025):

Well, so, here's what's happening.

Tab invokes tab completion. Tab completion at the beginning of a prompt searches for a command in the PATH.

Your PATH contains a lot of folders.

Every time you press Tab, it has to search all of those folders. This is a slow operation.

This isn't Terminal's doing, mind you. This is how your shell handles tab completion. It would be true in any shell that offers tab completion.

Setting PATH to /bin tells the shell "don't look for commands anywhere except /bin". This applies to both tab completion and normal command execution. That's why it breaks npm, of course.

But that's also why it makes a good diagnostic.

Since it works after setting the PATH to be very short, it proves that your problem is tab completion. It's not intended to be a fix, just a test.

Unfortunately, your actual issue lies somewhere outside of Terminal.

@DHowett commented on GitHub (Apr 14, 2025): Well, so, here's what's happening. <kbd>Tab</kbd> invokes tab completion. Tab completion at the beginning of a prompt searches for a command in the `PATH`. Your `PATH` contains a lot of folders. Every time you press <kbd>Tab</kbd>, it has to search _all of those folders_. This is a slow operation. This isn't Terminal's doing, mind you. This is how your shell handles tab completion. It would be true in any shell that offers tab completion. Setting `PATH` to `/bin` tells the shell "don't look for commands anywhere except `/bin`". This applies to both tab completion _and_ normal command execution. That's why it breaks `npm`, of course. But that's also why it makes a good diagnostic. Since it works after setting the `PATH` to be very short, it proves that your problem is tab completion. It's not intended to be a _fix,_ just a test. Unfortunately, your actual issue lies somewhere outside of Terminal.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#23112