-
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
CMD in "Current Console Mode" not cleared when vim exits #3177
Comments
Would you mind testing this with the MSYS2 runtime v3.2.0 as built here? You'll need to download the I ask because there has been a ton of work on the pseudo terminal front in v3.2.0, and the issue you reported might Just Be Fixed there already. Thank you! |
Thanks @dscho! Good idea. After extracting However, I discovered that the issue does not occur when vim is invoked directly: cd "C:\Program Files\Git" && usr\bin\vim etc\gitconfig However, it does occur when invoked directly if set TERM=cygwin
cd "C:\Program Files\Git" && usr\bin\vim etc\gitconfig The above behavior is consistent between the msys runtime shipped with the current release and the build you suggested. |
I had another look at this and was actually able to reproduce the behavior, but not when running with MSYS2 runtime v3.2.0 and setting Can you confirm my finding? |
Thanks for investigating @dscho. Good find! Unfortunately, I'm unable to confirm. After extracting set MSYS=enable_pcon
git config --system -e The console is not cleared after exiting vim. In case it is relevant, set MSYS=enable_pcon
set TERM=cygwin
cd "C:\Program Files\Git" && usr\bin\vim etc\gitconfig Let me know if you are unable to reproduce the issue with |
Funnily enough, when I set |
Interesting! I am able to reproduce the behavior you described with MSYS2 runtime v3.2.0: set MSYS=enable_pcon
set TERM=xterm256-color
git config --system -e
set TERM=cygwin
git config --system -e
git config --system -e The console is not cleared after exiting vim the first time. It is cleared the second time. It is not cleared the third time (or any subsequent times). I think the cause might be related to the cursor position when vim is started. For me, the console is cleared if the cursor is at the bottom of the window when vim is started: If I press Enter until the cursor is at the bottom of the window, then run |
Since this is an issue even with |
I tried running running vim in the Cygwin64 Terminal from Cygwin 3.2.0 and got:
I can investigate further, but I am not sure it would be worth the effort. Since the issue only occurs with Note: Vim supports terminal information with several |
I meant Cygwin's own
We specifically set |
On my system,
Good to know. Presumably that is programs using the msys2 runtime other than vim (which uses colors in cmd when Keep in mind, different terminal emulators support different sets of "ANSI sequences". I suspect |
Great, so we're getting closer to pinpointing this on Cygwin :-) I vaguely remember a little flurry of ConPTY-related patches entering Cygwin. You wouldn't have time to cherry-pick them on top of git-for-windows/msys2-runtime#30 and let GitHub Actions rebuild the runtime, would you?
Possible. Do you know how |
Sure. I cherry-picked
onto Warning: The second patch required conflict resolution. I think I resolved it correctly, but I would recommend against using my branch for anything other than testing.
It looks like the choice is made by cygwin/msys2 in choosing which terminal to emulate. In "Legacy Console Mode":
In "Current Console Mode":
|
I bet it is this line: https://github.com/git-for-windows/msys2-runtime/blob/12e88192b84673b81c6550e48fb7df9b607dada3/winsup/cygwin/environ.cc#L962 It calls More interesting, however, is how Now, there are problems with doing that in |
Good find and analysis! That makes a lot of sense. For what it's worth, I fixed a conflict resolution error in the second commit and build #2 succeeded. Unfortunately, it exhibits the same behavior as the other versions. |
Right. With all that information as armor, do you think you can take this to the Cygwin mailing list? Like, I am pretty certain that their enabling the virtual terminal processing when |
Almost. I'm still unclear on is why git must set |
Alternatively, if that's not clear, and there are concerns about unknown backwards compatibility risks, I'm willing to raise the issue on the Cygwin mailing list as is. But I wouldn't be surprised if "it doesn't work when I do this" is met with "then don't do that". 😆 |
I went ahead and posed the question to the Cygwin mailing list: https://cygwin.com/pipermail/cygwin/2021-April/248406.html |
i am also seeing this but i have
on my and if i run
env of git CMD:
output of tset on git cmd is xterm-256color
|
if i manually do |
There has been again a flurry of ConPTY fixes, as well as some work-around in Git for Windows specifically for calling Could I solicit y'all's assistance in testing with the latest snapshot? I'd like to close this ticket. |
Thanks @dscho. I'm still able to reproduce the issue with git version 2.35.1.windows.2.7.g158a30d60b.20220224121117. |
@kevinoid Thank you for testing. I don't want to give you any illusions: I won't be able to investigate this issue let alone working on resolving it, that's why I hoped that we would "inherit" fixes from the Cygwin project by virtue of rebasing the MSYS2 runtime to the newest Cygwin runtime version. I still hope that that will get us a fix for your issue in the long run. |
Thanks @dscho, I appreciate the clarity. Is that due to lack of time, or other factors? Either is understandable, I'm just curious if there may be anything I can do to unblock it. |
Time. I'm really scarce on unplanned-for time. |
remove workaround for git-for-windows/git#3177 vim now correctly clears the screen when exiting on conPTY
LuanVSO/pwsh-profile@3806c56 claims that this may no longer be an issue? |
Correct, I've been using it without the workaround for quite some time, sorry for forgetting to update this thread |
Good. The ticket is addressed, then. |
Setup
None that I am aware of.
Details
CMD (with Legacy Console Mode disabled)
Minimal, Complete, and Verifiable example
this will help us understand the issue.
The problem occurs for after commands which invoke vim (e.g.
git commit
,git diff
,git rebase -i
, etc.). An easy way to reproduce the issue from inside or outside a repo:Console would be cleared when vim is exited as it is in Legacy Console Mode:
Console is not cleared and file content being edited in vim remains in the console around the prompt:
Note: The issue does not appear if git is configured to use vim v8.2.2767 from vim/vim-win32-installer. The issue appears to be specific to the msys2 version of vim shipped with git.
Thanks for reading,
Kevin
The text was updated successfully, but these errors were encountered: