Skip to content

After exiting commit editor whole console get cleared #5303

Description

@Yankes
  • [ v] I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.47.1.windows.1
cpu: x86_64
built from commit: 2cd22437f64229935dc564db969cbcbfed5e9045
sizeof-long: 4
sizeof-size_t: 8
shell-path: D:/git-sdk-64-build-installers/usr/bin/sh
feature: fsmonitor--daemon
libcurl: 8.11.0
OpenSSL: OpenSSL 3.2.3 3 Sep 2024
zlib: 1.3.1

Older version git version 2.24.1.windows.2 do not had this problems.

  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.19045.5131]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
> type "$env:USERPROFILE\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

Editor Option: VIM
Custom Editor Path:
Default Branch Option:
Path Option: BashOnly
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFCommitAsIs
Bash Terminal Option: MinTTY
Git Pull Behavior Option: FFOnly
Use Credential Manager: Enabled
Performance Tweaks FSCache: Enabled
Enable Symlinks: Disabled
Enable FSMonitor: Disabled

  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

Added tmux with libs from libevent from msys2

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Bash with mintty

When using vim whole console get cleared, I boils down this problem to:

git config core.editor "f(){ echo $'\e[?1049h\e[22;0;0t'; echo \"Write to \$1\"; cat > \"\$1\"; echo $'\e[?1049l\e[23;0;0;t'; }; f"
git commit --amend
  • What did you expect to occur after running these commands?

I can see content in console like (all console history before commit):

[10:08][Yankes:~/prog/dummy] (master)
$ tmux

[11:08][Yankes:~/prog/dummy] (master)
$ vim

[12:08][Yankes:~/prog/dummy] (master)
$ git config core.editor "f(){ echo $'\e[?1049h\e[22;0;0t'; echo \"Write to \$1\"; cat > \"\$1\"; echo $'\e[?1049l\e[23;0;0;t'; }; f" && git commit --amend
hint: Waiting for your editor to close the file...
[master ea17ecf] eeee
 Date: Sat Dec 7 00:06:33 2024 +0100
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 foo
[12:13][Yankes:~/prog/dummy] (master)
$
  • What actually happened instead?

Lot of empty space and final commit result message:











hint: Waiting for your editor to close the file...
[t-feature/merge-appka c315b8b668] aaaa
 Date: Fri Dec 6 16:22:31 2024 +0100
 1 file changed, 1 insertion(+)
 create mode 100644 dummy
[12:13][Yankes:~/prog/dummy] (master)
$

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

No, clean repository is enough.

Overall vim have too some problems with gathering info about terminal and mess up my colors
when run through git.

Activity

  1. dscho commented on Mar 3, 2025

    @dscho
    Member

    f(){ echo $'\e[?1049h\e[22;0;0t'; echo \"Write to \$1\"; cat > \"\$1\"; echo $'\e[?1049l\e[23;0;0;t'; }; f

    Isn't this more an issue for https://github.com/mintty/mintty?

    Also, you assume quite a bit of context without trying to help any reader along should they lack that context. What are you trying to accomplish with the \e[?1049h/\e[?1049l sequences? And what with the \e[22;0;0t/\e[23;0;0t ones? I can see no description of them on https://github.com/mintty/mintty/wiki/CtrlSeqs, and I have to admit that I feel quite annoyed by the terseness of this issue description as well as the willingness to put quite the burden and time tax on anyone who dares to try to make any sense of this report. I find it very inconsiderate to write such a report that would require such a lot of research merely to understand what the bug report is trying to say.

  2. Yankes commented on Mar 3, 2025

    @Yankes
    Author

    I do not think is problem with mintty as same happens under tmux and problem appear only after updating git version.

    As for my example, template ask for minimal example, and I simply could have broken vim config that could interfere with git.
    Therefore I extracted control codes that vim send to swap screens in xterm that work fine in other contexts but when git run vim something get confused.
    I was hoping that two line example that allow reproduce bug is enough (as this exact code work on other machines with older git or diffret git distributions).
    Its hard for me to add more context how its work as only thing I could provide some random pages I find when I look what escape codes vim output and make sense of this why it with git mess up my console.

    As far I understand
    \e[?1049h ask terminal to switch to temporary screen without scroll back (typical vim usage)
    \e[?1049l ask terminal to go back to normal terminal screen with previous content (typical used by bash)
    for \e[22;0;0t and \e[23;0;0;t I do not know what point of it is, simply vim output them. when I now remove it problem still presentient. I could probably reduce it more but as I could break git in less than 200 characters I thought this is minimal enough.

  3. dscho commented on Mar 3, 2025

    @dscho
    Member

    I cannot promise anything, but there is an off-chance that git-for-windows/msys2-runtime#87 might fix your problem. To test, download the install artifact from https://github.com/git-for-windows/msys2-runtime/actions/runs/13628995018?pr=87#artifacts, extract its usr\bin\msys-2.0.dll and (temporarily) replace your regular Git installation's version, then try again?

  4. Yankes commented on Mar 3, 2025

    @Yankes
    Author

    After replacing msys dll it still behave same, but looking on description of that error it could be related.
    I will maybe install fresh version too as I did not update it from time of report.

  5. TomasMalecek commented on Mar 5, 2025

    @TomasMalecek

    I am facing the same issue even under different circumstances -- after using a pager, e.g., via git diff.

    In my ~/.profile, I have export LESS=RS as I want the pager's content not to pollute the scrollback. After an update (sadly I am not sure about the original version), I started getting this weird behavior where a part of the previous scrollback content gets overwritten with blank space. It happens when Vim (core.editor) or Less (core.pager) are executed. When the scrollback is long enough, it can be seen that the top is OK and only the last several lines (whose number exactly matches the height of the window) are cleared.

    By the way, while trying to quickly get some scrollback content, I came across a separate issue and reported it as #5468. The details of my setup are mentioned there. I also reproduced both issues on the latest snapshot (built from 1424e27), specifically its portable version.

  6. TomasMalecek commented on Mar 5, 2025

    @TomasMalecek

    I tried playing with the options in the LESS environment variable and with core.pager only to realize that when I execute less separately, directly on the command line, without Git, it does not exhibit this weird behavior.

  7. Yankes commented on Mar 7, 2025

    @Yankes
    Author

    I made experiment, and run git from cmd, and its look like it work here correctly.
    Interesting when I pipe output it fix this behavior:

    git commit --amend | cat

    aside of butchering vim, it fix console clearing.

    [ps]

    another interesting thing is that when using tmux :pipe-pane to track what is send to terminal I see that git intercept my escape codes and manually clear whole console using \e[K codes. Maybe it get confused what $TERM is set now? at least my tmux report screen-256color.

  8. TomasMalecek commented on Apr 25, 2025

    @TomasMalecek

    Inside VS Code's terminal, this issue is not reproducible.

  9. smacdonald-kai commented on Apr 22, 2026

    @smacdonald-kai

    tl;dr - I am also affected on the latest version

    Git For Windows version

    git version 2.53.0.windows.3
    cpu: x86_64
    built from commit: f8165afd89b0c190677a093f20894f5fce12f97a
    sizeof-long: 4
    sizeof-size_t: 8
    shell-path: D:/git-sdk-64/usr/bin/sh
    rust: disabled
    feature: fsmonitor--daemon
    gettext: enabled
    libcurl: 8.18.0
    OpenSSL: OpenSSL 3.5.5 27 Jan 2026
    zlib: 1.3.1
    SHA-1: SHA1_DC
    SHA-256: SHA256_BLK
    default-ref-format: files
    default-hash: sha1
    

    Windows version

    Microsoft Windows [Version 10.0.26200.8246]
    (c) Microsoft Corporation. All rights reserved.
    

    Options

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

    Other things about my environment

    I am working on an inherited laptop that's had tool collisions in the past. This appears not to be one of those, as my colleague with a bog standard install (didn't ask the version number but can get that) has the exact same configuration for all items checked so far, and has the exact same bug.

    I've spent about half a day with Copilot digging into this. We have checked a lot of possibilities.
    It has a theory that seems reasonable: direct-launched vim is attached to a pty0 but git-launched vim is attached to a cons0 and that difference is causing the issue.
    Test to show this data:

    • launch vim from the command line $ vim, or, use $ GIT_EDITOR=vim git commit to launch vim
    • inside vim: :!ps -f
    • observe this difference between the two scenarios (emphasis mine):
         UID     PID    PPID  TTY        STIME COMMAND
    smacdona   41709   40722 ?        12:34:23 usr/bin/mintty --nodaemon -o AppID=GitForWindows.Bash -o AppLaunchCmd=C:\Program Files\Git\
    smacdona   41710   41709 pty4     12:34:23 /usr/bin/bash --login -i
    smacdona   39579   39578 pty1     14:53:34 /usr/bin/bash --login -i
    smacdona   41085       1 ?        11:39:40 usr/bin/mintty --nodaemon -o AppID=GitForWindows.Bash -o AppLaunchCmd=C:\Program Files\Git\
    smacdona   41785   41784 **pty0**     12:41:56 ps -f
    smacdona   41086   41085 pty3     11:39:41 /usr/bin/bash --login -i
    smacdona   39872   39871 pty2     15:03:47 /usr/bin/bash --login -i
    smacdona   40722       1 ?        10:57:48 usr/bin/mintty --nodaemon -o AppID=GitForWindows.Bash -o AppLaunchCmd=C:\Program Files\Git\
    smacdona   39578       1 ?        14:53:34 usr/bin/mintty --nodaemon -o AppID=GitForWindows.Bash -o AppLaunchCmd=C:\Program Files\Git\
    smacdona   41784   40723 **pty0**     12:41:50 vim
    smacdona   39871       1 ?        15:03:47 usr/bin/mintty --nodaemon -o AppID=GitForWindows.Bash -o AppLaunchCmd=C:\Program Files\Git\
    smacdona   40723   40722 pty0     10:57:48 /usr/bin/bash --login -i
    
    git commit vim:
    hint: Waiting for your editor to close the file...
         UID     PID    PPID  TTY        STIME COMMAND
    smacdona   41709   40722 ?        12:34:23 usr/bin/mintty --nodaemon -o AppID=GitForWindows.Bash -o AppLaunchCmd=C:\Program Files\Git\
    smacdona   41710   41709 pty4     12:34:23 /usr/bin/bash --login -i
    smacdona   39579   39578 pty1     14:53:34 /usr/bin/bash --login -i
    smacdona   41085       1 ?        11:39:40 usr/bin/mintty --nodaemon -o AppID=GitForWindows.Bash -o AppLaunchCmd=C:\Program Files\Git\
    smacdona   41796   41795 **cons0**    12:42:40 ps -f
    smacdona   41086   41085 pty3     11:39:41 /usr/bin/bash --login -i
    smacdona   39872   39871 pty2     15:03:47 /usr/bin/bash --login -i
    smacdona   40722       1 ?        10:57:48 usr/bin/mintty --nodaemon -o AppID=GitForWindows.Bash -o AppLaunchCmd=C:\Program Files\Git\
    smacdona   39578       1 ?        14:53:34 usr/bin/mintty --nodaemon -o AppID=GitForWindows.Bash -o AppLaunchCmd=C:\Program Files\Git\
    smacdona   39871       1 ?        15:03:47 usr/bin/mintty --nodaemon -o AppID=GitForWindows.Bash -o AppLaunchCmd=C:\Program Files\Git\
    smacdona   41794   40723 pty0     12:42:37 "C:\Program Files\Git\mingw64\bin\git.exe" commit ash -o□
    smacdona   40723   40722 pty0     10:57:48 /usr/bin/bash --login -i
    smacdona   41795       1 **cons0**    12:42:37 vim 
    

    Using

    Git For Windows bash started via the Windows 11 taskbar Search field, which invokes mintty

    Reproducible Example

    • be working from the bash command line in a repository, developing code
    • observe the terminal's scrollback contains lots of history
    • $ GIT_EDITOR=vim git commit
    • exit immediately aborting the commit (the commit itself isn't relevant, it's the vim-invoked-by-git that's important) (also, the exact repository isn't relevant either)
    • observe that a big chunk of the terminal's scrollback is lost/blank

    Notes

    This does not happen with vim that is invoked from the bash command line; in that case the scrollback is correctly restored.

    For the record, OP's report is just about identical to mine.

  10. smacdonald-kai commented on Apr 22, 2026

    @smacdonald-kai

    I made experiment, and run git from cmd, and its look like it work here correctly. Interesting when I pipe output it fix this behavior:

    git commit --amend | cat

    I can confirm this | cat does in fact cause my reproducible example to no longer reproduce.
    Here's the :!ps -f from inside git-launched vim; I think the "fixing" part is that cat has a pty0 as the end of the command line pipeline. vim still has cons0 but isn't responsible for restoring the terminal due to being the middle of the command line pipeline (or rather, not the end of the pipeline).

    hint: Waiting for your editor to close the file... Vim: Warning: Output is not to a terminal
         UID     PID    PPID  TTY        STIME COMMAND
    smacdona   43129   42546 ?        16:17:19 usr/bin/mintty --nodaemon -o AppID=GitForWindows.Bash -o AppLaunchCmd=C:\Program Files\Git\git-bash.exe -o AppName=Git Bash -i C:\Program Files\Git\git-bash.exe --store-taskbar-properties -- /usr/bin/bash --login -i
    smacdona   41709       1 ?        12:34:23 usr/bin/mintty --nodaemon -o AppID=GitForWindows.Bash -o AppLaunchCmd=C:\Program Files\Git\git-bash.exe -o AppName=Git Bash -i C:\Program Files\Git\git-bash.exe --store-taskbar-properties -- /usr/bin/bash --login -i
    smacdona   43257   43130 pty0     16:40:42 /usr/bin/bash --login -i
    smacdona   42546       1 ?        14:39:42 usr/bin/mintty --nodaemon -o AppID=GitForWindows.Bash -o AppLaunchCmd=C:\Program Files\Git\git-bash.exe -o AppName=Git Bash -i C:\Program Files\Git\git-bash.exe --store-taskbar-properties -- /usr/bin/bash --login -i
    smacdona   41710   41709 pty4     12:34:23 /usr/bin/bash --login -i
    smacdona   39579   39578 pty1       Apr 21 /usr/bin/bash --login -i
    smacdona   42489       1 ?        14:34:26 usr/bin/mintty --nodaemon -o AppID=GitForWindows.Bash -o AppLaunchCmd=C:\Program Files\Git\git-bash.exe -o AppName=Git Bash -i C:\Program Files\Git\git-bash.exe --store-taskbar-properties -- /usr/bin/bash --login -i
    smacdona   39872   39871 pty2       Apr 21 /usr/bin/bash --login -i
    smacdona   43262   43261 cons0    16:40:48 ps -f
    smacdona   39578       1 ?          Apr 21 usr/bin/mintty --nodaemon -o AppID=GitForWindows.Bash -o AppLaunchCmd=C:\Program Files\Git\git-bash.exe -o AppName=Git Bash -i C:\Program Files\Git\git-bash.exe --store-taskbar-properties -- /usr/bin/bash --login -i
    smacdona   43260   43257 pty0     16:40:42 "C:\Program Files\Git\mingw64\bin\git.exe" commit ash -o▒
    smacdona   43259   43130 pty0     16:40:42 cat
    smacdona   39871       1 ?          Apr 21 usr/bin/mintty --nodaemon -o AppID=GitForWindows.Bash -o AppLaunchCmd=C:\Program Files\Git\git-bash.exe -o AppName=Git Bash -i C:\Program Files\Git\git-bash.exe --store-taskbar-properties -- /usr/bin/bash --login -i
    smacdona   42490   42489 pty6     14:34:26 /usr/bin/bash --login -i
    smacdona   42547   42546 pty7     14:39:42 /usr/bin/bash --login -i
    smacdona   43130   43129 pty0     16:17:19 /usr/bin/bash --login -i
    smacdona   43261       1 cons0    16:40:42 vim C:/Users/smacdonald/work/ndt-ui-clean/.git/COMMIT_EDITMSG
    smacdona   43244   42547 pty7     16:37:09 vim bisect
    

    Also, just for clarity and assuming OP's test case works, vim isn't really important either. Copilot's theory is that the t_ti and ort_te sequences are being dropped then the last application is attached to a cons0 instead of a pty0.

  11. smacdonald-kai commented on Apr 22, 2026

    @smacdonald-kai

    OP mentions that the problem exists in 2.47.1.windows.1 but not in 2.24.1.windows.2.

    I've downloaded all those releases (61 of them) and will bisect to find the version that introduces the bug. This will take some time as it requires a full uninstall / reinstall cycle for each test, but, ceil(log2(61) + 1) = 6 so at least not too many attempts.

  12. smacdonald-kai commented on Apr 23, 2026

    @smacdonald-kai

    Bisecting didn't take all that long after all.

    (During set up there are 2 initial button clicks to get past Windows User Account Control, then 13 clicks to accept all options as default values. whee)

    Summary:

    15 FAIL    Git for Windows v2.41.0.windows.1       v2.41.0.windows.1   2023-06-01T17:34:43Z
    16 PASS    Git for Windows 2.40.1                  v2.40.1.windows.1   2023-04-25T17:15:01Z
    

    This corresponds to the introduction of the cons0 instead of the pty0 (see below for the full log).

    Bisect log:

    Bad: 2.47.1.windows.1
    
    00 FAIL    Git for Windows v2.47.1.windows.1       v2.47.1.windows.1   2024-11-25T15:00:15Z
    01         Git for Windows v2.47.0.windows.2       v2.47.0.windows.2   2024-10-22T10:50:42Z
    02         Git for Windows v2.47.0.windows.1       v2.47.0.windows.1   2024-10-08T10:04:05Z
    03         Git for Windows v2.46.2.windows.1       v2.46.2.windows.1   2024-09-24T13:01:23Z
    04         Git for Windows v2.46.1.windows.1       v2.46.1.windows.1   2024-09-18T08:58:29Z
    05         Git for Windows v2.46.0.windows.1       v2.46.0.windows.1   2024-07-29T18:56:08Z
    06         Git for Windows v2.45.2.windows.1       v2.45.2.windows.1   2024-06-03T09:13:36Z
    07         Git for Windows v2.45.1                 v2.45.1.windows.1   2024-05-14T17:10:06Z
    08         Git for Windows v2.45.0.windows.1       v2.45.0.windows.1   2024-04-29T20:36:07Z
    09         Git for Windows v2.44.1                 v2.44.1.windows.1   2024-05-14T17:25:37Z
    10         Git for Windows v2.44.0.windows.1       v2.44.0.windows.1   2024-02-23T20:57:31Z
    11         Git for Windows v2.43.0.windows.1       v2.43.0.windows.1   2023-11-20T19:00:55Z
    12         Git for Windows v2.42.0.windows.2       v2.42.0.windows.2   2023-08-30T11:09:40Z
    13         Git for Windows v2.42.0.windows.1       v2.42.0.windows.1   2023-08-21T20:06:29Z
    14         Git for Windows v2.41.0.windows.3       v2.41.0.windows.3   2023-07-13T23:06:02Z
    15 FAIL    Git for Windows v2.41.0.windows.1       v2.41.0.windows.1   2023-06-01T17:34:43Z
    16 PASS    Git for Windows 2.40.1                  v2.40.1.windows.1   2023-04-25T17:15:01Z
    17 PASS    Git for Windows v2.40.0.windows.1       v2.40.0.windows.1   2023-03-14T07:51:54Z
    18         Git for Windows 2.39.2                  v2.39.2.windows.1   2023-02-14T18:11:17Z
    19 PASS    Git for Windows 2.39.1                  v2.39.1.windows.1   2023-01-17T18:05:28Z
    20         Git for Windows 2.39.0(2)               v2.39.0.windows.2   2022-12-21T14:44:06Z
    21         Git for Windows 2.39.0                  v2.39.0.windows.1   2022-12-12T16:59:50Z
    22         Git for Windows 2.38.1                  v2.38.1.windows.1   2022-10-18T17:04:47Z
    23 PASS    Git for Windows 2.38.0                  v2.38.0.windows.1   2022-10-03T18:49:29Z
    24         Git for Windows 2.37.3                  v2.37.3.windows.1   2022-08-30T22:09:54Z
    25         Git for Windows 2.37.2(2)               v2.37.2.windows.2   2022-08-12T00:30:30Z
    26         Git for Windows 2.37.1                  v2.37.1.windows.1   2022-07-12T17:16:27Z
    27         Git for Windows 2.37.0                  v2.37.0.windows.1   2022-06-27T19:21:01Z
    28         Git for Windows 2.36.1                  v2.36.1.windows.1   2022-05-09T18:19:26Z
    29         Git for Windows 2.36.0                  v2.36.0.windows.1   2022-04-20T15:23:47Z
    30 PASS    Git for Windows 2.35.3                  v2.35.3.windows.1   2022-04-15T02:45:54Z
    31         Git for Windows 2.35.2                  v2.35.2.windows.1   2022-04-12T17:06:16Z
    32         Git for Windows 2.35.1(2)               v2.35.1.windows.2   2022-02-01T16:43:26Z
    33         Git for Windows 2.35.1                  v2.35.1.windows.1   2022-01-29T07:58:02Z
    34         Git for Windows 2.35.0                  v2.35.0.windows.1   2022-01-24T22:45:02Z
    35         Git for Windows 2.34.1                  v2.34.1.windows.1   2021-11-25T11:49:24Z
    36         Git for Windows 2.34.0                  v2.34.0.windows.1   2021-11-15T19:52:38Z
    37         Git for Windows 2.33.1                  v2.33.1.windows.1   2021-10-13T23:42:20Z
    38         Git for Windows 2.33.0(2)               v2.33.0.windows.2   2021-08-24T11:34:33Z
    39         Git for Windows 2.33.0                  v2.33.0.windows.1   2021-08-17T10:29:51Z
    40         Git for Windows 2.32.0(2)               v2.32.0.windows.2   2021-07-06T21:36:27Z
    41         Git for Windows 2.32.0                  v2.32.0.windows.1   2021-06-07T13:06:26Z
    42         Git for Windows 2.31.1                  v2.31.1.windows.1   2021-03-27T10:27:03Z
    43         Git for Windows 2.31.0                  v2.31.0.windows.1   2021-03-15T22:04:20Z
    44         Git for Windows 2.30.2                  v2.30.2.windows.1   2021-03-09T18:07:40Z
    45         Git for Windows 2.30.1                  v2.30.1.windows.1   2021-02-09T13:41:03Z
    46         Git for Windows 2.30.0(2)               v2.30.0.windows.2   2021-01-14T11:25:35Z
    47         Git for Windows 2.30.0                  v2.30.0.windows.1   2020-12-28T19:41:36Z
    48         Git for Windows v2.29.2(3)              v2.29.2.windows.3   2020-12-08T14:22:24Z
    49         Git for Windows 2.29.2(2)               v2.29.2.windows.2   2020-11-04T23:57:14Z
    50         Git for Windows 2.29.2                  v2.29.2.windows.1   2020-10-30T15:21:24Z
    51         Git for Windows 2.29.1                  v2.29.1.windows.1   2020-10-23T22:48:40Z
    52         Git for Windows 2.29.0                  v2.29.0.windows.1   2020-10-19T21:02:14Z
    53         Git for Windows 2.28.0                  v2.28.0.windows.1   2020-07-28T10:31:18Z
    54         Git for Windows 2.27.0                  v2.27.0.windows.1   2020-06-01T19:16:02Z
    55         Git for Windows 2.26.2                  v2.26.2.windows.1   2020-04-20T18:04:32Z
    56         Git for Windows 2.26.1                  v2.26.1.windows.1   2020-04-14T18:33:08Z
    57         Git for Windows 2.26.0                  v2.26.0.windows.1   2020-03-23T13:00:17Z
    58         Git for Windows 2.25.1                  v2.25.1.windows.1   2020-02-19T18:30:02Z
    59         Git for Windows 2.25.0                  v2.25.0.windows.1   2020-01-13T21:37:14Z
    60 PASS    Git for Windows 2.24.1(2)               v2.24.1.windows.2   2019-12-10T19:22:30Z
    
    Good: 2.24.1.windows.2
    
    
    Results of running ':!ps -f' from inside vim
    --------------------------------------------------------------------------------
    
    v2.24.1.windows.2  PASS
    hint: Waiting for your editor to close the file...
         UID     PID    PPID  TTY        STIME COMMAND
    smacdona    1916    1837 pty0     22:57:38 /mingw64/bin/git
    smacdona    1917       1 pty0     22:57:38 /usr/bin/vim
    smacdona    1918    1917 pty0     22:57:43 /usr/bin/ps
    smacdona    1836       1 ?        22:46:03 /usr/bin/mintty
    smacdona    1837    1836 pty0     22:46:03 /usr/bin/bash
    
    
    v2.35.3.windows.1  PASS
    hint: Waiting for your editor to close the file...
         UID     PID    PPID  TTY        STIME COMMAND
    smacdona    2002    2001 pty0     01:52:53 /usr/bin/ps
    smacdona    2001       1 pty0     01:52:48 /usr/bin/vim
    smacdona    2000    1931 pty0     01:52:48 /mingw64/bin/git
    smacdona    1931    1930 pty0     01:49:05 /usr/bin/bash
    smacdona    1930       1 ?        01:49:05 /usr/bin/mintty
    
    
    v2.41.0.windows.1  FAIL
    hint: Waiting for your editor to close the file...
         UID     PID    PPID  TTY        STIME COMMAND
    smacdona     687     686 cons0    01:59:21 /usr/bin/ps
    smacdona     686       1 cons0    01:59:17 /usr/bin/vim
    smacdona     619       1 ?        01:57:36 /usr/bin/mintty
    smacdona     620     619 pty0     01:57:36 /usr/bin/bash
    smacdona     685     620 pty0     01:59:17 /mingw64/bin/git
    
    
    v2.38.0.windows.1  PASS
    hint: Waiting for your editor to close the file...
         UID     PID    PPID  TTY        STIME COMMAND
    smacdona     563     490 pty0     02:09:28 /mingw64/bin/git
    smacdona     489       1 ?        02:08:03 /usr/bin/mintty
    smacdona     565     564 pty0     02:09:35 /usr/bin/ps
    smacdona     564       1 pty0     02:09:28 /usr/bin/vim
    smacdona     490     489 pty0     02:08:03 /usr/bin/bash
    
    
    v2.39.1.windows.1  PASS
    hint: Waiting for your editor to close the file...
         UID     PID    PPID  TTY        STIME COMMAND
    smacdona     833     832 pty0     08:24:56 /usr/bin/ps
    smacdona     774       1 ?        08:24:25 /usr/bin/mintty
    smacdona     832       1 pty0     08:24:53 /usr/bin/vim
    smacdona     775     774 pty0     08:24:25 /usr/bin/bash
    smacdona     831     775 pty0     08:24:53 /mingw64/bin/git
    
    
    v2.40.0.windows.1  PASS
    hint: Waiting for your editor to close the file...
         UID     PID    PPID  TTY        STIME COMMAND
    smacdona    1866       1 pty0     08:28:03 /usr/bin/vim
    smacdona    1865    1808 pty0     08:28:02 /mingw64/bin/git
    smacdona    1808    1807 pty0     08:27:43 /usr/bin/bash
    smacdona    1807       1 ?        08:27:43 /usr/bin/mintty
    smacdona    1867    1866 pty0     08:28:06 /usr/bin/ps
    
    
    v2.40.1.windows.1  PASS
    hint: Waiting for your editor to close the file...
         UID     PID    PPID  TTY        STIME COMMAND
    smacdona     752     751 pty0     08:32:17 /usr/bin/bash
    smacdona     751       1 ?        08:32:17 /usr/bin/mintty
    smacdona     809     752 pty0     08:32:50 /mingw64/bin/git
    smacdona     811     810 pty0     08:32:55 /usr/bin/ps
    smacdona     810       1 pty0     08:32:50 /usr/bin/vim
    
  13. smacdonald-kai commented on Apr 23, 2026

    @smacdonald-kai

    Using the | cat workaround has other problems.

    It only works directly from the command-line, or at least, all my attempts to have it work as a git alias, bash alias, or external helper script have failed. Usually this is because cat is also attached to a cons0, near as I can tell.

    When it does work direct from the command line, the restored scrollback then also includes all the output from the alternate screen! Most of the time this is nothing, especially for commit message editing, but, sometimes it's very much quite a lot of output.

    So the current situation seems to be "live with the bug until it's fixed". :-(

  14. chrisbra commented on Apr 23, 2026

    @chrisbra

    When it works, can you show the output of :set t_ti? t_te? in Vim? And then compare if this is different when it doesn't work? I guess those are not set then?

  15. 17 remaining items

  16. santoslgl01-web commented on Apr 30, 2026

    @santoslgl01-web
  17. smacdonald-kai commented on May 4, 2026

    @smacdonald-kai

    I iterated on the patch and contributed it for review here: https://inbox.sourceware.org/cygwin-patches/[email protected]

    Patch looks good to me, caveat I've never worked in the codebase before.

    Because I read over the weekend that some AI(s) is(are) inserting co-author credits into commit messages regardless of whether it is warranted/deserved, I have to ask if "Assisted-by: Claude Opus 4.7 (1M context)" is on purpose or not?
    See https://news.ycombinator.com/item?id=47989883 .

    Thanks for the patch. I'll test at the next opportunity, whether that's a manual update or just waiting for the next Git for Windows release that includes the patch.

  18. dscho commented on May 4, 2026

    @dscho
    Member

    I have to ask if "Assisted-by: Claude Opus 4.7 (1M context)" is on purpose or not?

    I used it to hunt down promising leads, and to type out the patch under my guidance. So I would say that it is merited to credit Opus with assisting me. The code still is all mine, I instructed the LLM to write it in the way it did.

  19. added this to the Next release milestone on Jul 14, 2026
  20. dscho commented on Jul 14, 2026

    @dscho
    Member

    /add relnote bug The long-standing bug where Git Bash's screen was cleared after git.exe called vim (e.g. to edit a commit message) was fixed.

    The workflow run was started

  21. added a commit that references this issue on Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions