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

ANSI escape codes in output using git for windows #13101

Closed
jcrben opened this issue May 14, 2022 · 5 comments
Closed

ANSI escape codes in output using git for windows #13101

jcrben opened this issue May 14, 2022 · 5 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@jcrben
Copy link

jcrben commented May 14, 2022

NOTE: I've seen some reports which suggest that this would be fixed by later Windows versions, so I'm on the Windows Insider preview... I've seen this with another application (https://github.com/go-task/task); I've also used ansicon to get around it but that cuts out some of the scrollback

Windows Terminal version

1.12.10983.0

Windows build number

10.0.22621.0

Other Software

No response

Steps to reproduce

Download https://search.maven.org/search?q=a:junit-platform-console-standalone by clicking the Download link
image

Install java: winget install Microsoft.OpenJDK.11
Install Git for Windows interactively: winget install Git.Git -i

When installing Git for Windows, enable the option to add it to the Microsoft Terminal

Open a Git Bash tab:

Execute the following:
`cd ~/Downloads; 'C:\Program Files\Microsoft\jdk-11.0.15.10-hotspot\bin\java.exe' -jar ./junit-platform-console-standalone-1.8.2.jar;

The output contains ANSI escape codes:
image

Expected Behavior

Colored output (or bolded, underlined - not sure what the codes map over to)

Actual Behavior

ANSI escape codes

@jcrben jcrben added the Issue-Bug It either shouldn't be doing this or needs an investigation. label May 14, 2022
@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 May 14, 2022
@ianjoneill
Copy link
Contributor

I believe this is the same issue as #6634 - see over there for more information.

@zadjii-msft
Copy link
Member

This does look like the same thing as /dup #6634 to me. See #6634 (comment) specifically.

@ghost
Copy link

ghost commented May 16, 2022

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!

@ghost ghost closed this as completed May 16, 2022
@ghost ghost 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 Needs-Tag-Fix Doesn't match tag requirements labels May 16, 2022
@zadjii-msft zadjii-msft closed this as not planned Won't fix, can't repro, duplicate, stale May 16, 2022
@jcrben
Copy link
Author

jcrben commented May 16, 2022

That closed issue doesn't really explain things very well for the average user who isn't intimately familiar with the architecture of terminals, consoles, and shells. Is there a TL;DR as to why you can't just fix this by tracking and making PRs against these upstream clients? Why not keep things like this open and track these legacy applications, especially when it's something as huge as java? This team is going to be the most motivated to add flags which specifically target your Windows architecture. Otherwise this issue probably just remain for the next decade or so and you'll keep getting duplicate issue reports.

Note that just using the terminal which ships with Git for Windows, ANSI escape codes are displayed properly.

I'm willing to make a PR against the jdk I suppose but it's going to take me far longer and I'd be flying pretty blind in doing so.

@jcrben
Copy link
Author

jcrben commented May 16, 2022

Also it's just a bit unclear to me - sounds like this is kind of a hack to allow legacy applications which do a bad thing to still work at the cost of not supporting these escape codes, but just want to make sure - it doesn't impose an ongoing requirement that terminal apps for *nix add special hacks just for Microsoft Terminal, does it? That seems like a battle that would never end @DHowett

Also maybe allow an option for users to break legacy applications and rip the band-aid off?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. 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

3 participants