Terminal: Render `tig` correctly

Created on 20 May 2019  ·  23Comments  ·  Source: microsoft/terminal

It would be great if the program tig worked properly in Terminal.

Here is a screenshot using tig on this repo:
image

Area-Rendering Issue-Bug Product-Terminal Resolution-External Tracking-External

Most helpful comment

Huh. To be entirely fair, this also doesn't work _outside_ of Terminal ...

image

This is likely due to Cygwin's VT emulation layer. I just tried it out with Cygwin >= 3.1, which _gets rid of the VT emulation layer_, and...

image

switch it back to 3.0.7 (has the VT emulation layer), and ...

image

We probably just need to wait for Git for Windows to upgrade to a runtime that is less old.

All 23 comments

I cloned the repo on mac and checked out roughly the same commit that Windows was on. So, the images should be nearly identical except for the first entry.
Screenshot 2019-05-20 16 00 56

Puzzlingly, this is what I get from 0.1.1361.0:

image

Wow, this was a terrible bug report. Here are some details:
Windows: 10.0.18898 Build 18898
Terminal: 0.1.1361.0
Powershell Core: 6.2.0

I'm able to print some emojis:
image

Is this WSL tig, Cygwin tig, tig over ssh, or some other tig build? I can't reproduce it with WSL tig, which leads me to believe that (if it's Cygwin tig) it might be trying to do something irresponsible because the runtime's knowledge of Consoles stopped evolving back before I was born. :grin:

So, this is tig in the command prompt:

```§ SHAWUTWIN {C:cMySource} [MySourceSomeBranch ↓2 ↑57 +5 ~0 -0 !]which tig Definition

C:Program FilesGitusrbintig.exe```

This looks like an upstream bug with git/cygwin/msys2/msys/whatever it is today. @bitcrazed will take on moving this upstream.
(EDIT: sorry other Rich Turner)

Another problem when using tig is incorrect indentation in diffs (if the change has more than one line):

Broken in WSL:
image

The way it's supposed to look:
image

I am using WSL tig:

$ whereis tig
tig: /usr/bin/tig /usr/share/man/man1/tig.1.gz
$ tig --version
tig version 2.3.0

Microsoft Windows [Version 10.0.17763.914]

@johannesherr That feels to me like mixed up tabstops, which I believe we fixed for 10.0.18362.

@DHowett-MSFT Ok, thanks for the info. Then I will wait and hope to get the update soon. :) Until then it's unfortunately back to Cygwin for me.

@bitcrazed Is there an upstream issue on msys/cygwin/whatever that's tracking this currently?

@bitcrazed Rich Turner FTE Is there an upstream issue on msys/cygwin/whatever that's tracking this currently?

Not that I know of. Will work with @cinnamon-msft to get this tracked.

@johannesherr & @decriptor - do you have any repro text that we can test and verify against?

I'm having a slightly different render issue than previous comments.

image

The timeline lines render correctly put pressing "Enter" over a commit to bring up the message/diff gets glitchy with the divider. Also, resizing is completely broken.

I'm using Git Bash with Git for Windows 2.25.0.

$ tig --version
tig version 2.5.0
ncursesw version 6.1.20190615
readline version 8.0

$ cat ~/.tigrc
set main-options = --all --date-order

set line-graphics = utf-8

@ToadKing Thanks for the info - what version of Terminal are you using?

FWIW, the team are cranking through bugs as we speak. Running Terminal v.0.9.433.0, I tried tig v2.3.0 on the Terminal repo in an Ubuntu/WSL2 session. Things look a little better (esp. re. disc symbol rendering size):
image

Hit ENTER:
image

Resizing also seems to be somewhat improved:
image

🙏 If anyone would like to add rendering glitches to this thread, please mark/circle/highlight specific issues and describe what you'd expect to see ... its sometimes a little tricky to pick out issues from a brief description. Thanks

I'm using Terminal 0.9.433.0.

Running tig from WSL works fine, it looks like the issues I'm running into are specifically with Git for Bash/Cygwin builds of tig. Also, it seems the corruption mainly happens when the log/diff appears in a horizontal panel like in my screenshot, not a vertical one in yours.

win10 1909 18363.778
terminal 0.10.781.0
msys2 20190524 (uses cygwin 3.0.7)
power shell core 6.1

Not sure if terminal problem or msys2/cygwin but still getting both rendering irregularities mentioned in this thread - branch graph, and details view (wsl works fine)

image

@UncleInf Can you share the commandline from your msys/gitbash/cygwin profile?

If it just launches bash, instead of bash -li, that would be why this isn't working.

I get the same error in Git Bash installed with Git for Windows.

{
    "guid": "{118dc651-b866-4c21-8507-4962c09b9922}",
    "name" : "Git Bash",
    "commandline" : "C:/Program Files/Git/bin/bash.exe --cd-to-home",
    "icon" : "C:/Program Files/Git/mingw64/share/git/git-for-windows.ico",
    "startingDirectory" : "%HOMEDRIVE%%HOMEPATH%",
    "fontSize": 11
}

Adding -li to the commandline doesn't fix it.

Huh. To be entirely fair, this also doesn't work _outside_ of Terminal ...

image

This is likely due to Cygwin's VT emulation layer. I just tried it out with Cygwin >= 3.1, which _gets rid of the VT emulation layer_, and...

image

switch it back to 3.0.7 (has the VT emulation layer), and ...

image

We probably just need to wait for Git for Windows to upgrade to a runtime that is less old.

Just an observation...

I run Terminal v1.4.2652.0 and run Git for Windows 2.27.0 (I know it's not the latest version) and it uses 3.1.4. I use tig all day every day and can't remember when I've last seen things happened as mentioned above.

Frank@pc247 MINGW64 /c/Source
$ git --version
git version 2.27.0.windows.1

Frank@pc247 MINGW64 /c/Source
$ uname -a
MINGW64_NT-10.0-19041 pc247 3.1.4-340.x86_64 2020-05-19 12:55 UTC x86_64 Msys

I think most of the problem was fixed in Git for Windows release 2.27. Tig renders normally for me now, for the most part. I still get some spurious spacing in console output when tig shells out to commit. I also get an occasional hang when transitioning back to tig after committing. But it's much better!

I can confirm tig renders correctly in Windows Terminal now as well. Git for Windows version 2.29.2.windows.1

Oh, well that's a pleasant surprise! I guess we can just close this one out then, thanks for the follow-ups all!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

warpdesign picture warpdesign  ·  3Comments

ghvanderweg picture ghvanderweg  ·  3Comments

mrmlnc picture mrmlnc  ·  3Comments

mdtauk picture mdtauk  ·  3Comments

zadjii-msft picture zadjii-msft  ·  3Comments