-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strange characters are shown in the terminal after git config -e --global
#3579
Comments
Running Git for Windows' Contrary to my suspicion, the culprit is neither https://github.com/git-for-windows/msys2-runtime/blob/70d23484c10a2f093a11e28085099c972cd1e72d/winsup/cygwin/fhandler_tty.cc#L2126 nor https://github.com/git-for-windows/msys2-runtime/blob/70d23484c10a2f093a11e28085099c972cd1e72d/winsup/cygwin/fhandler_tty.cc#L3145 nor https://github.com/git-for-windows/msys2-runtime/blob/70d23484c10a2f093a11e28085099c972cd1e72d/winsup/cygwin/fhandler_tty.cc#L3624. |
Turns out that there is a much easier way to trigger this: launch $ /git-cmd.exe --command=/usr/bin/vim.exe ~/.gitconfig; hexdump -C Side note: Maybe unrelated, but maybe not, if the file to be edited is empty, there are no strange characters showing up. If it is not empty, but less than a screen-full of content, only something like Another side note: if |
The idea behind this is, of course, to launch the MSYS2 program |
Another data point: the problem occurs with https://repo.msys2.org/msys/x86_64/msys2-runtime-3.2.0-13-x86_64.pkg.tar.zst, but not with https://repo.msys2.org/msys/x86_64/msys2-runtime-3.1.7-8-x86_64.pkg.tar.zst (those are the most adjacent versions still available on repo.msys2.org). |
Is that with mintty?
Okay let's see:
I think Vim would only send those, if a terminal pretends to be xterm (so $TERM=xterm), if I recall correctly. Not sure why vim wouldn't consume those on startup. Perhaps those are returned too late? All of those request strings can be explicitly disabled, see |
Yes.
That would make sense.
Precisely! Very rarely, I even see
That's a safe guess, I think. I see e.g. this hack in the Cygwin runtime that has an arbitrary, hard-coded timeout, but this particular code seems not to be involved with the breakage.
That's good to know! If all else fails, I will have to do that for Git for Windows. My preference, though, would be to figure out where the MSYS2/Cygwin runtime is broken as of v3.2.0. |
So after spending a lot of time, I managed to identify the commit that introduced the regression: git-for-windows/msys2-runtime@f206417. Unfortunately, it looks as if that commit tries to do many things at the same time. At least to me, the intention is not at all clear. Even worse, I cannot put my finger on the spot that causes the strange characters to be sent to the terminal instead of @tyan0 any insights from your side? |
Thank you for this reply. The included patch works around the issue. I will now work on integrating it (even if I am still unhappy to say that even the diff failed to clarify the problem and the solution, conceptually). |
When launching an MSYS2 process via a non-MSYS2 process, the response for, say, a CSI [ 6n (Device Status Report) sent from that MSYS2 process was sometimes not sent (or sent only partially) to the process but to the terminal instead. This regression was introduced in f206417 (Cygwin: pty: Reduce unecessary input transfer., 2021-02-11). While it is not yet completely clear why, this patch fixes this. The explanation is left for the commit message that Takashi will craft for the Cygwin project, but we will take this patch early into the MSYS2/Git for Windows projects. This addresses git-for-windows/git#3579
Our trusted Azure Pipeline is building and uploading the |
When launching an MSYS2 process via a non-MSYS2 process, the response for, say, a CSI [ 6n (Device Status Report) sent from that MSYS2 process was sometimes not sent (or sent only partially) to the process but to the terminal instead. This regression was introduced in f206417 (Cygwin: pty: Reduce unecessary input transfer., 2021-02-11). While it is not yet completely clear why, this patch fixes this. The explanation is left for the commit message that Takashi will craft for the Cygwin project, but we will take this patch early into the MSYS2/Git for Windows projects. This addresses git-for-windows/git#3579
And it succeeded! |
When using MSYS2 runtime v3.3.3 in a regular Git Bash, after
git config -e --global
launchedvim
and the editor was closed, seemingly random characters are "ghost-typed".This might be a "funny" interaction between the MSYS2 runtime, MinTTY and
vim
.Concretely, I see 1R77;30502;0c10;rgb:bfbf/bfbf/bfbf11;rgb:0000/0000/0000 being "ghost-typed" every time Git has called vi for editing a file.
To be precise, the hexdump -C output is this:
Originally reported in git-for-windows/build-extra#399 (comment)
The text was updated successfully, but these errors were encountered: