-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
msys true in pipe to vim with termguicolors causes escape codes to be displayed in terminal #12289
Comments
For reference, I'm also able to reproduce the issue with Vim 8.2.0916, although the behavior is slightly different: The screen is initially blank, but pressing any keys (including Ctrl-L to redraw) causes the escape codes to appear as in 8.4.4227. |
@kevinoid Git with Git with I'm not sure who's doing the coloring, the application or the terminal. |
@elsaco That's a good observation. I think it's a related, but separate issue. (I'm not sure whether it's a bug since I'm not sure how the color escape sequences git produces should be interpreted once vim enables Note that the reproduction I provided for this issue doesn't actually invoke |
I just realized that the issue can be reproduced without (@echo off & for /l %x in (1, 1, 100) do "C:\Program Files\Git\usr\bin\true.exe") | vim --clean --cmd "set tgc" - To reproduce with @(1..100) | ForEach-Object { & 'C:\Program Files\Git\usr\bin\true.exe' } | vim --clean --cmd 'set tgc' - I am unable to reproduce the issue with non-msys programs. For example, the issue does not occur with: (@echo off & for /l %x in (1, 1, 100) do findstr foo C:\Windows\system.ini) | vim --clean --cmd "set tgc" - |
Wait how did we never triage this one? This does look like the same thing as /dup #6634 to me. See #6634 (comment) specifically. |
Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! |
@zadjii-msft Do I understand correctly that you think |
It's a race condition, unfortunately. The console mode is global state, and spawning Part of this is due to how pipelines work: vim is starting up and configuring the console handle before any given instance of It probably looks like this:
The cached value from 4 reflects the console state at the time it was launched, and it cannot be aware of vim's changes in 5 when step 6 happens. |
Windows Terminal version
1.11.3471.0
Windows build number
10.0.19043.1466
Other Software
Git 2.35.0
Vim 8.4.4227
Steps to reproduce
To reproduce with
cmd
(in WT or Conhost), run:To reproduce with
powershell
orpwsh
(in WT or Conhost), run:It can also be reproduced by running
git show $commit
ifcore.pager=vim
,vimrc
hasset tgc
, and $commit includes changes to a .docx file, which is how I initially encountered the issue: Git for Windows has*.docx diff=astextplain
which invokes astextplain which invokes docx2txt.pl which invokesunzip
twice. I found the reproduction to be more reliable if perl invokes another program more times. 100 invocations reliably reproduces the issue on my system.Expected Behavior
Vim would show its default empty-input startup screen:
Actual Behavior
The first and last row of the terminal shows what appear to be terminal escape codes. Keyboard input changes the escape codes, rather than appearing as expected:
The text was updated successfully, but these errors were encountered: