You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
git bash loses / mangles order of keyboard input received while busy #5632
Note that the t keypress was received after gi was processed and printed, but while the prompt was being redrawn. The inserted t was then placed at the front of the command, instead of the end.
kevin@GGCOMP MINGW64 ~
$ git --version
git version 2.49.0.windows.1
You can also reproduce a similar behavior if you type while a longer-running command is executing; e.g. just typing after running git and while the usage output is being printed.
I've grabbed the dll (from mingit-x86_64, hopefully the correct place) and will let you know if I see it again.
The issue I see is when typing something like git checkout main while waiting on the prompt to return from a previous command, a character will be shifted to the start. The input I see could be cgit chekout main or git checkoutmain (space at the start). It seems more likely to happen under resource constrained conditions, when the time between commands is longer.
The issue I see is when typing something like git checkout main while waiting on the prompt to return from a previous command, a character will be shifted to the start. The input I see could be cgit chekout main or git checkoutmain (space at the start). It seems more likely to happen under resource constrained conditions, when the time between commands is longer.
That matches pretty precisely the symptoms I emulate in those UI tests, and that were supposedly addressed by those fixes...
I've grabbed the dll (from mingit-x86_64, hopefully the correct place) and will let you know if I see it again.
Well, now there is a new snapshot with that new MSYS2 runtime. Remember, snapshots are designed to be as close to "continuous releases" as I can make them, they are even code-signed. So, in theory, you should be able to update to that snapshot and everything (including the keystroke order) should work fine.
Sorry for the delay. Chiming in to say I tested with the latest snapshot built today, and the issue appears to be entirely resolved for me. Thanks again!
kevin@GGCOMP MINGW64 ~
$ git --version
git version 2.53.0.windows.2.8.gf549d3f011.20260331112157
Still seeing it. Wasn't sure whether it was really happening or if I was mistyping (git -> tig is innocuous enough) but I did get some bad ones today. Greatly assisted by my laptop being very slow.
I recorded my terminal + keyboard out of an abundance of paranoia and got a few clips of it happening.
tig.mp4o.gitcheckut.mp4pt.gistash.po.mp4
Also note that the cursor flicks back to the start of the line when typing in the first 10~20 columns. It's most clearly visible in the third video. That doesn't happen outside the snapshot build.
As a possible reproduction, I also noticed text completely disappearing when I run git diff when I had a one-line change in the working directory, meaning that it wouldn't open the pager. Typing git checkout main (without pressing enter) before git diff returned might lead to only having ain appearing in the text area. This seems like a separate issue though (something to do with the pager?), given that it eats the characters instead of rearranging them. This git diff consuming behaviour happens both on the snapshot and 2.53.0.2, so there's no regression at least.
@j4-c4 for the record, I also saw this yesterday. My machine was under heavy load, and I did a long typeahead, and a large chunk that should have been at the end was now in the middle.
My suspicion is that there is still a tiny time window in which the input transfer between MSYS and native consumer is too late as the input has been partially consumed, or something like that. At this point, I am seeing this very rarely, though (I've been running with this fix for weeks now and yesterday was the first time it hit me, and I was putting a lot of load on my machine). Meaning: At this point, I think we crossed the threshold of diminishing returns, and I cannot really justify pouring more time into it.
Maybe one of @tyan0's additional fixes (he was really busy and produced some patches that I am seriously happy about) will alleviate this issue; IIUC Cygwin v3.6.8 is imminent and we'll find out as soon as it trickled down to Git for Windows (and by "trickle down" I mean, of course, "I will work as hard as always to rebase MSYS2's and Git for Windows' patches on top, verify that everything works as expected, and then deploy it to Git for Windows' SDK").
Activity
kevinushey commentedon May 24, 2025
You can also reproduce a similar behavior if you type while a longer-running command is executing; e.g. just typing after running
gitand while the usage output is being printed.KalleOlaviNiemitalo commentedon May 29, 2025
I have also been seeing this, but I think only in Windows Terminal. I don't remember seeing this in conhost or mintty.
dscho commentedon Sep 5, 2025
I experience this in MinTTY all the time. If only I had enough time to copy/edit one of the AutoHotKey-based tests in https://github.com/git-for-windows/msys2-runtime/tree/HEAD/ui-tests to get a reliable reproducer. Maybe one of you gentle people in this here ticket could help out?
ui-tests: add mintty launch and capture helpers to the library
ui-tests: add a reproducer for the keystroke reordering bug
amend! ui-tests: add mintty launch and capture helpers to the library
amend! ui-tests: add mintty launch and capture helpers to the library
amend! ui-tests: add a reproducer for the keystroke reordering bug
pty: fix unintended character reordering when running native Windows …
Cygwin: pty: Fix jumbled keystrokes by removing the per-keystroke pip…
Cygwin: pty: Remove pcon_start readahead flush that displaces readlin…
Cygwin: pty: Prevent premature pseudo console teardown that amplifies…
Cygwin: pty: Guard accept_input routing and flush stale readahead in …
Merge branch 'fix-jumbled-keys'
fixup! Add AGENTS.md with comprehensive project context for AI agents
60 remaining items
j4-c4 commentedon Mar 31, 2026
I've grabbed the dll (from mingit-x86_64, hopefully the correct place) and will let you know if I see it again.
The issue I see is when typing something like
git checkout mainwhile waiting on the prompt to return from a previous command, a character will be shifted to the start. The input I see could becgit chekout mainorgit checkoutmain(space at the start). It seems more likely to happen under resource constrained conditions, when the time between commands is longer.dscho commentedon Mar 31, 2026
That matches pretty precisely the symptoms I emulate in those UI tests, and that were supposedly addressed by those fixes...
Well, now there is a new snapshot with that new MSYS2 runtime. Remember, snapshots are designed to be as close to "continuous releases" as I can make them, they are even code-signed. So, in theory, you should be able to update to that snapshot and everything (including the keystroke order) should work fine.
kevinushey commentedon Apr 1, 2026
Sorry for the delay. Chiming in to say I tested with the latest snapshot built today, and the issue appears to be entirely resolved for me. Thanks again!
j4-c4 commentedon Apr 1, 2026
Still seeing it. Wasn't sure whether it was really happening or if I was mistyping (
git->tigis innocuous enough) but I did get some bad ones today. Greatly assisted by my laptop being very slow.I recorded my terminal + keyboard out of an abundance of paranoia and got a few clips of it happening.
tig.mp4
o.gitcheckut.mp4
pt.gistash.po.mp4
Also note that the cursor flicks back to the start of the line when typing in the first 10~20 columns. It's most clearly visible in the third video. That doesn't happen outside the snapshot build.
As a possible reproduction, I also noticed text completely disappearing when I run
git diffwhen I had a one-line change in the working directory, meaning that it wouldn't open the pager. Typinggit checkout main(without pressing enter) beforegit diffreturned might lead to only havingainappearing in the text area. This seems like a separate issue though (something to do with the pager?), given that it eats the characters instead of rearranging them. Thisgit diffconsuming behaviour happens both on the snapshot and2.53.0.2, so there's no regression at least.dscho commentedon Apr 21, 2026
@j4-c4 for the record, I also saw this yesterday. My machine was under heavy load, and I did a long typeahead, and a large chunk that should have been at the end was now in the middle.
My suspicion is that there is still a tiny time window in which the input transfer between MSYS and native consumer is too late as the input has been partially consumed, or something like that. At this point, I am seeing this very rarely, though (I've been running with this fix for weeks now and yesterday was the first time it hit me, and I was putting a lot of load on my machine). Meaning: At this point, I think we crossed the threshold of diminishing returns, and I cannot really justify pouring more time into it.
Maybe one of @tyan0's additional fixes (he was really busy and produced some patches that I am seriously happy about) will alleviate this issue; IIUC Cygwin v3.6.8 is imminent and we'll find out as soon as it trickled down to Git for Windows (and by "trickle down" I mean, of course, "I will work as hard as always to rebase MSYS2's and Git for Windows' patches on top, verify that everything works as expected, and then deploy it to Git for Windows' SDK").
ui-tests: add mintty launch and capture helpers to the library
ui-tests: add a reproducer for the keystroke reordering bug
ui-tests: add mintty launch and capture helpers to the library
ui-tests: add a reproducer for the keystroke reordering bug
ui-tests: add mintty launch and capture helpers to the library
ui-tests: add a reproducer for the keystroke reordering bug
ui-tests: add mintty launch and capture helpers to the library
ui-tests: add a reproducer for the keystroke reordering bug
ui-tests: add mintty launch and capture helpers to the library
ui-tests: add a reproducer for the keystroke reordering bug