Skip to content
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

Git-bash ansi/vt100 #4809

Closed
molszews opened this issue Mar 5, 2020 · 11 comments
Closed

Git-bash ansi/vt100 #4809

molszews opened this issue Mar 5, 2020 · 11 comments
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@molszews
Copy link

molszews commented Mar 5, 2020

Environment

Windows build number: Microsoft Windows NT 10.0.19041.0
Windows Terminal version: 0.9.433.0

Any other software?
Git for windows: 2.25.1 (picked cmd.exe instead of MinTTY as the terminal emulator for git-bash)
Git bash/uname: MINGW64_NT-10.0-19041 SPNTECHLAP16 3.0.7-338.x86_64 2019-11-21 23:07 UTC x86_64 Msys

Steps to reproduce

  1. Run git-bash through Windows Terminal
  2. Execute tool that produces ansi sequences, e.g. stern

Expected behavior

  1. Ansi/vt100 sequences are processed

Actual behavior

  1. Ansi/vt100 sequences are visible in terminal output

Comments

There are similar issues already here tracked, however, I'm not 100% sure if this is the same case (cygwin related issue #2837), as starting git-bash and running apps there works fine:
just git-bash

Problem is when the same git-bash is now started via Windows Terminal,
git-bash+win term

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Mar 5, 2020
@jdebp
Copy link

jdebp commented Mar 5, 2020

Compare #3767 and #4788.

@DHowett-MSFT
Copy link
Contributor

I'm fairly sure this is the same root cause as #2837 (comment) (the cygwin/msys2 runtime (which are pretty much the same code) isn't acting the same as it would in standard conhost, even though WT goes to great lengths to ensure that conhost things work as well as possible.)

Would you mind sharing the output of echo $TERM inside and outside WT, but in git-bash?

Additionally, would you mind sharing your git-bash profile snippet (from profiles.json)?

@DHowett-MSFT
Copy link
Contributor

(Tentative dupe ruling stands until more info comes in; closing)

@DHowett-MSFT DHowett-MSFT added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Mar 5, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Mar 5, 2020
@molszews
Copy link
Author

molszews commented Mar 6, 2020

both inside and outside WT, but in git-bash, echo $TERM results with cygwin
snippet from profiles.json:

{
            "guid": "{00000000-0000-0000-0000-000000000002}",
            "acrylicOpacity": 0.85,
            "closeOnExit": true,
            "colorScheme": "Solarized Dark",
            "commandline": "\"%PROGRAMFILES%\\git\\git-cmd.exe\" --no-cd --command=bin/bash.exe --login -i -l",
            "cursorColor": "#FFFFFF",
            "cursorShape": "bar",
            "fontFace": "Consolas",
            "fontSize": 14,
            "historySize": 9001,
            "icon": "ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png",
            "name": "git-bash",
            "snapOnInput": true,
            "startingDirectory": "c:\\git",
            "useAcrylic": true
        }

@molszews
Copy link
Author

molszews commented Mar 8, 2020

@DHowett-MSFT I've just managed to fix the problem by recompiling Git for windows using Cygwin 3.1.2 and essentially replacing the msys-2.0.dll (it is essentially the cygwin1.dll) binary - it works perfectly now!

@dahlbyk
Copy link

dahlbyk commented Mar 14, 2020

FWIW this was reported for git gui (dahlbyk/posh-git#738), and I can reproduce in conhost.

@patrikhuber
Copy link

patrikhuber commented Mar 14, 2020

Hi @DHowett-MSFT,

According to the git-gui developer, @prati0100, this is a Windows Terminal issue, and not a git-gui issue.

I don't think my issue is related to #2837 (comment), as I am using PowerShell 6 and not cygwin/msys2.

I am also not sure whether my issue is related to this issue which seems to be about git-bash, and I am using pwsh.

@DHowett-MSFT can you re-open this issue, or am I having a different bug and should I open a new issue?
As my issue seems neither a posh-git nor a git-gui issue and I am using PowerShell 6, the https://github.com/microsoft/terminal/ repository seems the right place for the bug I am encountering.

Thanks a lot.

@DHowett-MSFT
Copy link
Contributor

Hey @patrikhuber! What you’re seeing is definitely different from this issue; mind filing a separate one?

I’ve seen some unusual behavior with git-gui where launching it (a graphical application) resets the output handle to not process VT until the shell steps in and fixes it, but I haven’t grabbed console host traces to see what exactly is happening.

@DHowett-MSFT
Copy link
Contributor

(Incidentally: when I say it’s a Cygwin issue, it may still apply to git-gui even if you’re not knowingly using Cygwin. The runtime that it uses for being POSIXy cross-platform is derived from (or in some cases directly built from) Cygwin’s standard library 😄)

@patrikhuber
Copy link

patrikhuber commented Mar 14, 2020

@DHowett-MSFT Sure! I've opened #4921.

Thanks a lot for the quick reply!

(Ah I think I see what you mean. Git-gui probably uses Cygwin/msys2, so this might be related even though I am using PowerShell and not git-bash.)

@trajano
Copy link

trajano commented Jun 21, 2020

@molszews can you create a PR for https://github.com/git-for-windows/git that upgrades the libraries? Maybe that would get the ball rolling?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

6 participants