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
Vim opens with the first line missing and/or in Insert Mode (2.55.0.windows.5) #6403
Any command that brings up Vim with a pre-existing commit message or other editable file, such as:
git commit --amend
git cherry-pick --continue
git rebase -i
Expected behaviour
Vim should be pre-populated with the existing commit message (in the case where a commit message is being edited) or the complete list of existing commits (in the case of an interactive rebase). Vim should be in Normal Mode. The first line (i.e. the commit message subject or the first commit to be rebased) should not be blank or missing. The colours should be the usual ones.
See this screenshot from version 2.55.0.windows.4 for expected behaviour:
Actual behaviour
The behaviour is random and intermittent. The following can occur, sometimes more than one at a time:
Sometimes the first line is blank/missing.
Sometimes Vim is in Insert mode unexpectedly.
Sometimes the colours of the various components are different from usual.
Sometimes the first line is replaced with the string ;rgb:0000/0000/0000.
Sometimes the first line is replaced with the string ;rgb:bfbf/bfbf/bfbf.
My git commit adds ;rgb:bfbf/bfbf/bfbfrgb:0000/0000/0000, ;rgb:bfbf/bfbf/bfbf , or nothing on the first line and either switches to the insert mode or keeps the normal mode. The behavior is non-deterministic but I have observed all the combinations. When it switches to the insert mode, I need to press Esc twice to switch back to normal mode. When ;rgb:bfbf/bfbf/bfbfrgb:0000/0000/0000 is added on the first line, the color scheme seems as usual, but in the other cases, it is somehow shifted.
Installed 2.55.0.windows.5 with Visual Studio 18.9.3 today (updated from 18.9.2) and immediately ran into this.
When I run EDITOR="vim --cmd \"call ch_logfile('vim.log', 'w')\"" git commit, the log contains different sequences in "raw key input:". If I understand it correctly, it should mean that the issue is outside Vim.
I made some strides with resolving this (assisted by AI to do the tedious code path following and writing lots of code, mostly instrumenting to trace where the bytes get mis-routed).
Could I ask y'all to download the install artifact from https://github.com/git-for-windows/msys2-runtime/actions/runs/34651435562, extract its usr/bin/msys-2.0.dll, then temporarily replace the existing one in your Git for Windows setup to test? In my rudimentary testing, this fixed the bug reliably.
I've tested the PR build of msys-2.0.dll on my local setup, and it does appear to fix the issue. However, I want to make two observations:
The file size of the DLL is extremely large: 24 MB instead of the expected 3 MB. Since your code change was very small, I assume this is because of debug symbols or some other difference in the build process. It may be wise to test this again using the same build process that will be used for the production release, in case there is an aspect of the bug behaviour that differs between debug and release builds.
The colour scheme is now consistently the "new" one, different from version 2.55.0.windows.4. This isn't necessarily bad (personally, I prefer the new colour scheme, since it makes it much easier to read the commit message subject line in particular) but I think it would be wise to investigate and understand why your commit has an impact on the colour scheme, so it can be documented in the release notes, and so you can be confident this change is not introducing a more subtle bug. For example, maybe this commit also accidentally fixes a longstanding bug, and the colours have been wrong for a long time. I do vaguely remember that back when I started using Git for Windows (10+ years ago), the colour scheme was more readable, but at some point it changed to the less readable one we have in version 2.55.0.windows.4, and I was disappointed (but not enough to file a bug report). Maybe bisecting to find the commit that introduced that change would be worthwhile.
Activity
dscho commentedon Sep 9, 2026
I noticed the same! My hope is that #6402 might fix it.
TomasMalecek commentedon Sep 9, 2026
My
git commitadds;rgb:bfbf/bfbf/bfbfrgb:0000/0000/0000,;rgb:bfbf/bfbf/bfbf, or nothing on the first line and either switches to the insert mode or keeps the normal mode. The behavior is non-deterministic but I have observed all the combinations. When it switches to the insert mode, I need to press Esc twice to switch back to normal mode. When;rgb:bfbf/bfbf/bfbfrgb:0000/0000/0000is added on the first line, the color scheme seems as usual, but in the other cases, it is somehow shifted.Installed 2.55.0.windows.5 with Visual Studio 18.9.3 today (updated from 18.9.2) and immediately ran into this.
dscho commentedon Sep 9, 2026
Sadly, it doesn't :-(
TomasMalecek commentedon Sep 10, 2026
When I run
EDITOR="vim --cmd \"call ch_logfile('vim.log', 'w')\"" git commit, the log contains different sequences in "raw key input:". If I understand it correctly, it should mean that the issue is outside Vim.dscho commentedon Sep 10, 2026
@TomasMalecek you understand correctly, I expect the bug to reside within the MSYS2 runtime.
dscho commentedon Sep 12, 2026
I made some strides with resolving this (assisted by AI to do the tedious code path following and writing lots of code, mostly instrumenting to trace where the bytes get mis-routed).
Could I ask y'all to download the
installartifact from https://github.com/git-for-windows/msys2-runtime/actions/runs/34651435562, extract itsusr/bin/msys-2.0.dll, then temporarily replace the existing one in your Git for Windows setup to test? In my rudimentary testing, this fixed the bug reliably.dglynch commentedon Sep 12, 2026
I've tested the PR build of msys-2.0.dll on my local setup, and it does appear to fix the issue. However, I want to make two observations:
The file size of the DLL is extremely large: 24 MB instead of the expected 3 MB. Since your code change was very small, I assume this is because of debug symbols or some other difference in the build process. It may be wise to test this again using the same build process that will be used for the production release, in case there is an aspect of the bug behaviour that differs between debug and release builds.
The colour scheme is now consistently the "new" one, different from version 2.55.0.windows.4. This isn't necessarily bad (personally, I prefer the new colour scheme, since it makes it much easier to read the commit message subject line in particular) but I think it would be wise to investigate and understand why your commit has an impact on the colour scheme, so it can be documented in the release notes, and so you can be confident this change is not introducing a more subtle bug. For example, maybe this commit also accidentally fixes a longstanding bug, and the colours have been wrong for a long time. I do vaguely remember that back when I started using Git for Windows (10+ years ago), the colour scheme was more readable, but at some point it changed to the less readable one we have in version 2.55.0.windows.4, and I was disappointed (but not enough to file a bug report). Maybe bisecting to find the commit that introduced that change would be worthwhile.
dscho commentedon Sep 12, 2026
@dglynch thank you for testing!
Yes, the PR builds contain debug symbols, that's expected. I'll make sure to verify that the deployment results in the smaller size again.
About the color scheme: I'm not sure. There has been a version jump (3.6.9 ->3.6.10) IIRC...
dscho commentedon Sep 12, 2026
/add relnote bug A bug introduced in Git for Windows v2.55.0(5), which caused vim to often open existing files with the first line missing, was fixed.
The workflow run was started
Add a release note (bug)
dscho commentedon Sep 12, 2026
The deployed package contains an
msys-2.0.dllthat weighs around 3MB:Cygwin: pty: preserve terminal replies after PTY adoption
Cygwin: pty: prevent terminal replies from corrupting editor input (#142