Skip to content

Vim opens with the first line missing and/or in Insert Mode (2.55.0.windows.5) #6403

Closed
git-for-windows/msys2-runtime
#142

Description

@dglynch

Existing issues matching what you're seeing

  • I was not able to find an open or closed issue matching what I'm seeing

Git for Windows version

git version 2.55.0.windows.5
cpu: x86_64
built from commit: 32c4f7689275d233577576630e1ac5b7eb354eb0
sizeof-long: 4
sizeof-size_t: 8
shell-path: D:/git-sdk-64-build-installers/usr/bin/sh
rust: disabled
feature: fsmonitor--daemon
gettext: enabled
libcurl: 8.21.0
OpenSSL: OpenSSL 3.5.7 9 Jun 2026
zlib: 1.3.2
SHA-1: SHA1_DC
SHA-256: SHA256_BLK
default-ref-format: files
default-hash: sha1

Windows version

Windows 11

Windows CPU architecture

x86_64 (64-bit)

Additional Windows version information

Microsoft Windows [Version 10.0.26200.9168]

Options set during installation

Editor Option: VIM
Custom Editor Path:
Default Branch Option:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: WinSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Git Pull Behavior Option: Rebase
Use Credential Manager: Enabled
Performance Tweaks FSCache: Enabled
Enable Symlinks: Disabled
Enable FSMonitor: Disabled

Other interesting things

No response

Terminal/shell

Git Bash

Commands that trigger the issue

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:

Image

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.

See these screenshots for some examples:

Image Image Image

Repository

This behaviour is observed in every repo.

Activity

  1. dscho commented on Sep 9, 2026

    @dscho
    Member

    I noticed the same! My hope is that #6402 might fix it.

  2. TomasMalecek commented on Sep 9, 2026

    @TomasMalecek

    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.

  3. dscho commented on Sep 9, 2026

    @dscho
    Member

    I noticed the same! My hope is that #6402 might fix it.

    Sadly, it doesn't :-(

  4. TomasMalecek commented on Sep 10, 2026

    @TomasMalecek

    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.

  5. dscho commented on Sep 10, 2026

    @dscho
    Member

    @TomasMalecek you understand correctly, I expect the bug to reside within the MSYS2 runtime.

  6. dscho commented on Sep 12, 2026

    @dscho
    Member

    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.

  7. dglynch commented on Sep 12, 2026

    @dglynch
    Author

    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:

    1. 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.

    2. 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.

  8. dscho commented on Sep 12, 2026

    @dscho
    Member

    @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...

  9. dscho commented on Sep 12, 2026

    @dscho
    Member

    /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

  10. added a commit that references this issue on Sep 12, 2026
  11. dscho commented on Sep 12, 2026

    @dscho
    Member

    I'll make sure to verify that the deployment results in the smaller size again.

    The deployed package contains an msys-2.0.dll that weighs around 3MB:

    msys-2.0.dll weighs 3,293 KB
  12. added this to the Next release milestone on Sep 12, 2026
  13. self-assigned this
    on Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions