Git output oddly indented and sometimes causing crash with TERM=msys #13864

Open
opened 2026-01-31 03:54:18 +00:00 by claunia · 0 comments
Owner

Originally created by @poke on GitHub (May 22, 2021).

Windows Terminal version (or Windows build number)

1.7.1033.0

Other Software

Using Git for Windows version 2.31.1.windows.1 with the bundled vim v8.2.1895 with PowerShell 5.1.19041.906.

Steps to reproduce

In a new folder, enter the following commands after another:

PS C:\TerminalIssueRepro> $env:TERM = 'msys'
PS C:\TerminalIssueRepro> git init
PS C:\TerminalIssueRepro> 'bin/' > .gitignore
PS C:\TerminalIssueRepro> git add .\.gitignore
PS C:\TerminalIssueRepro> git commit

vim opens to prompt for a commit message, so enter something there, save and exit.

Expected Behavior

The console window should look like this:

PS C:\TerminalIssueRepro> git init
Initialized empty Git repository in C:/TerminalIssueRepro/.git/
PS C:\TerminalIssueRepro> 'bin/' > .gitignore
PS C:\TerminalIssueRepro> git add .\.gitignore
PS C:\TerminalIssueRepro> git commit
[main (root-commit) abe2cba] Initialize
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 .gitignore
PS C:\TerminalIssueRepro> 

Actual Behavior

Instead, due to the TERM=msys, the output looks like this:

PS C:\TerminalIssueRepro> git init
Initialized empty Git repository in C:/TerminalIssueRepro/.git/
PS C:\TerminalIssueRepro> 'bin/' > .gitignore
PS C:\TerminalIssueRepro> git add .\.gitignore
PS C:\TerminalIssueRepro> git commit
[main (root-commit) abe2cba] Initialize
                                        1 file changed, 0 insertions(+), 0 deletions(-)
                                                                                        create mode 100644 .gitignore

This can be reproduced by re-triggering vim for editing, e.g. using git commit --amend. Sometimes, the terminal process completely crashes after closing vim, e.g. with this output:

PS C:\TerminalIssueRepro> git commit --amend
[main 27a142f] Initialize
                          Date: Sat May 22 14:20:41 2021 +0200
                                                               1 file changed, 0 insertions(+), 0 deletions(-)
                                                                                                               create mode 100644 .gitignore
[Verarbeitung des Prozesses mit Code 5 beendet]

(Eror message says “Processing of process ended with code 5”)

If I switch to the TERM mode cygwin (the default I believe?), then the output will look ok in that there is no odd indentation and the process won’t crash. However doing so means that after exiting vim, the screen will be completely blank above the generated output, i.e. the vim process blanks the previous console output.

In ConEmu, using TERM=msys works without any problems, so does it in the native PowerShell host or cmd.exe.

Originally created by @poke on GitHub (May 22, 2021). ### Windows Terminal version (or Windows build number) 1.7.1033.0 ### Other Software Using Git for Windows version 2.31.1.windows.1 with the bundled vim v8.2.1895 with PowerShell 5.1.19041.906. ### Steps to reproduce In a new folder, enter the following commands after another: ``` PS C:\TerminalIssueRepro> $env:TERM = 'msys' PS C:\TerminalIssueRepro> git init PS C:\TerminalIssueRepro> 'bin/' > .gitignore PS C:\TerminalIssueRepro> git add .\.gitignore PS C:\TerminalIssueRepro> git commit ``` vim opens to prompt for a commit message, so enter something there, save and exit. ### Expected Behavior The console window should look like this: ``` PS C:\TerminalIssueRepro> git init Initialized empty Git repository in C:/TerminalIssueRepro/.git/ PS C:\TerminalIssueRepro> 'bin/' > .gitignore PS C:\TerminalIssueRepro> git add .\.gitignore PS C:\TerminalIssueRepro> git commit [main (root-commit) abe2cba] Initialize 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .gitignore PS C:\TerminalIssueRepro> ``` ### Actual Behavior Instead, due to the TERM=msys, the output looks like this: ``` PS C:\TerminalIssueRepro> git init Initialized empty Git repository in C:/TerminalIssueRepro/.git/ PS C:\TerminalIssueRepro> 'bin/' > .gitignore PS C:\TerminalIssueRepro> git add .\.gitignore PS C:\TerminalIssueRepro> git commit [main (root-commit) abe2cba] Initialize 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .gitignore ``` This can be reproduced by re-triggering vim for editing, e.g. using `git commit --amend`. Sometimes, the terminal process completely crashes after closing vim, e.g. with this output: ``` PS C:\TerminalIssueRepro> git commit --amend [main 27a142f] Initialize Date: Sat May 22 14:20:41 2021 +0200 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .gitignore [Verarbeitung des Prozesses mit Code 5 beendet] ``` (Eror message says _“Processing of process ended with code 5”_) If I switch to the `TERM` mode `cygwin` (the default I believe?), then the output will look *ok* in that there is no odd indentation and the process won’t crash. However doing so means that after exiting vim, the screen will be completely blank above the generated output, i.e. the vim process blanks the previous console output. In ConEmu, using TERM=msys works without any problems, so does it in the native PowerShell host or cmd.exe.
claunia added the Area-OutputResolution-Duplicate labels 2026-01-31 03:54:18 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#13864