"Shift-Tab" and "Tab" insert the same character in MSYS2 #16776

Closed
opened 2026-01-31 05:22:33 +00:00 by claunia · 9 comments
Owner

Originally created by @matteocoder on GitHub (Feb 14, 2022).

Windows Terminal version

1.12.10393.0

Windows build number

Microsoft Windows [Version 10.0.22000.493]

Other Software

GNU bash, version 4.4.23(2)-release (x86_64-pc-msys), Git for Windows 2.35.1.windows.2

Steps to reproduce

Prerequisites: install Git for Windows, then set up Git Bash in Windows Terminal as follows:

{
                "commandline": "C:\\Program Files\\Git\\bin\\bash.exe -i -l",
                "guid": "{763c51e6-3ab8-413c-b51c-2fd2abf9fba8}",
                "icon": "C:\\Program Files\\Git\\mingw64\\share\\git\\git-for-windows.ico",
                "name": "Git-Bash",
                "startingDirectory": "%USERPROFILE%",
                "tabTitle": "Git Bash"
            }

Also, make sure that ctrl-v is unbound in Windows Terminal.
Open Git Bash in Windows Terminal, then press ctrl-v, and finally shift-tab.

Expected Behavior

The escape code ^[[Z should be displayed on the screen.

Actual Behavior

Pressing shift-tab inserts a tab character anyway.

Originally created by @matteocoder on GitHub (Feb 14, 2022). ### Windows Terminal version 1.12.10393.0 ### Windows build number Microsoft Windows [Version 10.0.22000.493] ### Other Software GNU bash, version 4.4.23(2)-release (x86_64-pc-msys), Git for Windows 2.35.1.windows.2 ### Steps to reproduce Prerequisites: install Git for Windows, then set up Git Bash in Windows Terminal as follows: ``` { "commandline": "C:\\Program Files\\Git\\bin\\bash.exe -i -l", "guid": "{763c51e6-3ab8-413c-b51c-2fd2abf9fba8}", "icon": "C:\\Program Files\\Git\\mingw64\\share\\git\\git-for-windows.ico", "name": "Git-Bash", "startingDirectory": "%USERPROFILE%", "tabTitle": "Git Bash" } ``` Also, make sure that `ctrl-v` is unbound in Windows Terminal. Open Git Bash in Windows Terminal, then press `ctrl-v`, and finally `shift-tab`. ### Expected Behavior The escape code `^[[Z` should be displayed on the screen. ### Actual Behavior Pressing `shift-tab` inserts a tab character anyway.
claunia added the Issue-BugResolution-ExternalNeeds-Tag-Fix labels 2026-01-31 05:22:33 +00:00
Author
Owner

@DHowett commented on GitHub (Feb 14, 2022):

This seems to be an issue with Git Bash (or, more likely, the Cygwin-based MSYS2 runtime it is using):

image

Above, Shift+Tab working in WSL.

@DHowett commented on GitHub (Feb 14, 2022): This seems to be an issue with Git Bash (or, more likely, the Cygwin-based MSYS2 runtime it is using): <img width="479" alt="image" src="https://user-images.githubusercontent.com/189190/153931603-764f1477-f4c1-490d-a2cf-49cab039af0a.png"> Above, <kbd>Shift+Tab</kbd> working in WSL.
Author
Owner

@DHowett commented on GitHub (Feb 14, 2022):

What is the value of $TERM in your shell?

@DHowett commented on GitHub (Feb 14, 2022): What is the value of `$TERM` in your shell?
Author
Owner

@matteocoder commented on GitHub (Feb 14, 2022):

@DHowett it is xterm-256color. shift-tab works as it should in Git Bash launched through mintty.

This seems to be an issue with Git Bash (or, more likely, the Cygwin-based MSYS2 runtime it is using)

In that case, should I report the issue to them?

@matteocoder commented on GitHub (Feb 14, 2022): @DHowett it is `xterm-256color`. `shift-tab` works as it should in Git Bash launched through mintty. > This seems to be an issue with Git Bash (or, more likely, the Cygwin-based MSYS2 runtime it is using) In that case, should I report the issue to them?
Author
Owner

@DHowett commented on GitHub (Feb 14, 2022):

Curiously, I can't reproduce this inside Terminal or inside the traditional console host.

image image

What happens if you launch GIt Bash outside Terminal but using the old console window?

FWIW: MSYS2 has a special contract with mintty that means it avoids a bunch of the Windows input APIs, so it good for "right behavior" testing but bad for "is this Terminal's fault, Console's fault, or Windows' fault" testing 😄

@DHowett commented on GitHub (Feb 14, 2022): Curiously, I can't reproduce this inside Terminal _or_ inside the traditional console host. <img width="459" alt="image" src="https://user-images.githubusercontent.com/189190/153934138-1d5a5c4b-bf04-4080-a75b-5d4113ee9048.png"> <img width="246" alt="image" src="https://user-images.githubusercontent.com/189190/153934178-a397dc34-9822-40c3-873f-d49ea86540c3.png"> What happens if you launch GIt Bash outside Terminal but using the old console window? _FWIW: MSYS2 has a special contract with mintty that means it avoids a bunch of the Windows input APIs, so it good for "right behavior" testing but bad for "is this Terminal's fault, Console's fault, or Windows' fault" testing :smile:_
Author
Owner

@matteocoder commented on GitHub (Feb 14, 2022):

@DHowett Unfortunately it does not work in conhost either; I tried to use backward completion by setting bind '"\e[Z":menu-complete-backward' and bind 'TAB:menu-complete', but the completion options kept going forward as if I had pressed tab.

FWIW: MSYS2 has a special contract with mintty that means it avoids a bunch of the Windows input APIs, so it good for "right behavior" testing but bad for "is this Terminal's fault, Console's fault, or Windows' fault" testing 😄

I see... I'll keep that in mind if I find other issues in the future 😅.
Also, which key combination is necessary to press before entering a literal character in conhost?

@matteocoder commented on GitHub (Feb 14, 2022): @DHowett Unfortunately it does not work in conhost either; I tried to use backward completion by setting `bind '"\e[Z":menu-complete-backward'` and `bind 'TAB:menu-complete'`, but the completion options kept going forward as if I had pressed tab. > FWIW: MSYS2 has a special contract with mintty that means it avoids a bunch of the Windows input APIs, so it good for "right behavior" testing but bad for "is this Terminal's fault, Console's fault, or Windows' fault" testing 😄 I see... I'll keep that in mind if I find other issues in the future 😅. Also, which key combination is necessary to press before entering a literal character in conhost?
Author
Owner

@DHowett commented on GitHub (Feb 14, 2022):

A-ha! In that case, it would be prudent to report it to them -- we haven't changed that part of the console in quite some time!

@DHowett commented on GitHub (Feb 14, 2022): A-ha! In that case, it would be prudent to report it to them -- we haven't changed that part of the console in quite some time!
Author
Owner

@matteocoder commented on GitHub (Feb 14, 2022):

@DHowett Thank you for your help!

@matteocoder commented on GitHub (Feb 14, 2022): @DHowett Thank you for your help!
Author
Owner

@DHowett commented on GitHub (Feb 14, 2022):

Sure thing! I'm gonna close this one as external. If you don't mind following up with a link to the bug you file on their end, I'd appreciate it :)

@DHowett commented on GitHub (Feb 14, 2022): Sure thing! I'm gonna close this one as external. If you don't mind following up with a link to the bug you file on their end, I'd appreciate it :)
Author
Owner

@matteocoder commented on GitHub (Feb 14, 2022):

@DHowett Sure, here is the link.
Also, how do you insert a literal control character inside conhost?

@matteocoder commented on GitHub (Feb 14, 2022): @DHowett Sure, [here is the link](https://github.com/msys2/MSYS2-packages/issues/2861#issue-1137985473). Also, how do you insert a literal control character inside conhost?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#16776