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

Strip or honor ASCII color coding #1569

Open
jessehouwing opened this issue May 19, 2018 · 74 comments
Open

Strip or honor ASCII color coding #1569

jessehouwing opened this issue May 19, 2018 · 74 comments

Comments

@jessehouwing
Copy link
Contributor

Agent Version and Platform

2.133.3
Windows | Linux

VSTS Type and Version

VisualStudio.com

If VisualStudio.com, what is your account name? http://psd30.visualstudio.com

What's not working?

When a commandline tool issues ASCII colour coding information (e.g. �[?25l) they are shown in the logs and make it harder to read.

2018-05-19T15:43:16.7926995Z It looks like this is your first time using Cypress: 2.1.0
2018-05-19T15:43:16.7938560Z 
2018-05-19T15:43:16.7958404Z �[?25l[15:43:05]  Verifying Cypress can run /opt/vsts/_work/r1/a/xxx-CI/src/node_modules/cypress/dist/Cypress [started]
2018-05-19T15:43:16.7980465Z [15:43:06]  Verifying Cypress can run /opt/vsts/_work/r1/a/xxx-CI/src/node_modules/cypress/dist/Cypress [completed]
2018-05-19T15:43:16.8000804Z �[?25h
2018-05-19T15:43:16.8019478Z Opening Cypress...

It would be useful to either honor the color coding, somehow instruct/configure the terminal as monochrome or stripping out the nonsense characters.

@bryanmacfarlane
Copy link
Collaborator

Yeah, this is on our backlog. labelling as an enhancement.

@adamralph
Copy link

Any update? As the maintainer of a build package which uses ANSI colours, I'm starting to get questions.

@TingluoHuang
Copy link
Contributor

we are fixing this step by step.

  1. get all UTF-8 characters back correctly Set code page to 65001 (UTF8) #1975
  2. the Web UI might already support color coding. :)

@adamralph
Copy link

Thanks for the info. AFAIK the web UI still doesn't support ANSI colour codes, see https://dev.azure.com/blairconrad/SendComics/_build/results?buildId=9&view=logs&jobId=011e1ec8-6569-5e69-4f06-baf193d1351e&taskId=b8cbf579-6a08-5e02-2788-e25b5bd52b1b&lineStart=13&lineEnd=14&colStart=1&colEnd=1

@blairconrad you reported adamralph/bullseye#150 - are you still seeing this problem in the web UI?

@blairconrad
Copy link

@adamralph, I see no change. ANSI codes show up in the web UI:

https://dev.azure.com/blairconrad/SendComics/_build/results?buildId=13

@yaananth
Copy link
Member

The web UI supports minimal set of escape codes, but the full support is coming soon.
We are prioritizing this.
Since this is UI issue and not agent issue, feel free to post something here
https://developercommunity.visualstudio.com/spaces/21/visual-studio-team-services.html?type=idea

But we understand the request and are working on it.

@yaananth
Copy link
Member

yaananth commented Dec 12, 2018

Changes should be rolling out. We support ANSII color code now.
Here's what we support:

Graphics mode (m) -
0 (reset),
1 (bold),
3 (italic),
4 (underline),
22 (not bold),
23 (not italic),
24 (not underline),
39 (default fg),
49 (default bg),

fg colors - 30 (black), 31 (red), 32 (green), 33 (yellow), 34 (blue), 35 (magenta), 36 (cyan), 37 (white), 90 (grey)
bg colors - 40 (black), 41 (red), 42 (green), 43 (yellow), 44 (blue), 45 (magenta), 46 (cyan), 47 (white)

@TingluoHuang
Copy link
Contributor

Close this issue base on this colorful screenshot. :D
image

@blairconrad
Copy link

PRETTY!

@blairconrad
Copy link

Not to be a Negative Nelly, but I notice that while the completed build output looks nice and colourful, the in-progress output does not deal well with the ANSI codes:

image

(from the in-progress build of https://dev.azure.com/blairconrad/blair%20bullseye/_build/results?buildId=18)

@yaananth
Copy link
Member

That's a known limitation now unfortunately, we don't use the same view for both views :(
This is getting addressed though, just won't be super soon :)

@blairconrad
Copy link

Oh, thanks for the speedy response. Glad it's known!

@blairconrad
Copy link

I hate to complain, but as @adamralph noted over at adamralph/bullseye#199 (comment), in some cases the combination of the ANSI escape codes and < or > in the output confuse the renderer. I have created a minimal reproduction which you can see at https://dev.azure.com/blairconrad/azure-ansi/_build/results?buildId=22.

image

You can see the HTML produced for the ANSI-less and ANSI-ful output here:

<div style="top:192px;height:16px;" class="view-line">
  <span><span class="mtk1">2018-12-14T19:46:38.8739531Z&nbsp;No&nbsp;colour</span></span>
</div>
<div style="top:208px;height:16px;" class="view-line">
  <span><span class="mtk1">2018-12-14T19:46:38.8741003Z&nbsp;&lt;options&gt;</span></span>
</div>
<div style="top:224px;height:16px;" class="view-line">
  <span><span class="mtk1">2018-12-14T19:46:38.8758154Z&nbsp;</span></span>
</div>
<div style="top:240px;height:16px;" class="view-line">
  <span><span class="mtk1">2018-12-14T19:46:38.8759918Z&nbsp;Yellow&nbsp;foreground</span></span>
</div>
<div style="top:256px;height:16px;" class="view-line">
  <span><span class="mtk1"><span>2018-12-14T19:46:38.8761200Z </span>&zwnj;<span class="ansifg-y "><options></options></span>&zwnj;</span></span>
</div>

It seems that once the ASNI codes are used, <options> is translated into <options></options> instead of &lt;options&gt;.

Is https://developercommunity.visualstudio.com/spaces/21/visual-studio-team-services.html?type=idea still the right place to mention this or is there a better place?

@yaananth
Copy link
Member

yaananth commented Dec 15, 2018

Here are the known limitations with this feature -

  • Visually text won't appear selected if you try to select the text (but copy-paste works)
  • Live feed won't honor color codes
  • Color codes with < > tags will make them disappear

This is something we decided to live with until we address all of them together in the next spike which is planned soon. We decided to go ahead with the feature even with those as it's much better than showing some random useless characters :)

If you are curios on the limitations, we use monaco editor, which isn't really made for "viewing" experience. So to bring color coding support, we had to have those limitations for the interm...

Thanks for reporting and we understand the issues you mentioned and we plan to work on those, let us know if you find anything else.

For this particular issue, I think having it here makes sense as everything is being discussed here, but in general yes, dev community is the place to track these.

@blairconrad
Copy link

Thanks for the response @yaananth. I had doubts about https://developercommunity.visualstudio.com/spaces/21/visual-studio-team-services.html?type=idea as the "idea" at the end sounds more like feature requests, not bug reports.

I eagerly await the next release and appreciate all your efforts.

And I realize that every client is different, but given the choice between "bonus funny characters in the output" and "some sections of the output just omitted altogether", I'd've picked the second. The recovery mode of the first is "just try not to look at the funny characters" while for the second it's "hopefully realize something is wrong and then pore over the source HTML".

@yaananth
Copy link
Member

You can report a problem: https://developercommunity.visualstudio.com/content/problem/post.html?space=21

@adamralph
Copy link

@yaananth earlier you said:

We decided to go ahead with the feature even with those...

So you have knowingly introduced a bug. Why do you need someone to "report" it?

@olafurpg
Copy link

olafurpg commented Mar 9, 2019

Visually text won't appear selected if you try to select the text (but copy-paste works)

@yaananth Is there an open issue to fix this limitation? I searched in the Visual Studio Community but couldn't find a related discussion. Copy-paste works for in-progress builds but it stops working when the colors have rendered after the build completes. To reproduce, try copy-pasting line 4000 from the CmdLine entry in https://dev.azure.com/olafurpg/Metals/_build/results?buildId=51

@sbachstein
Copy link

Have there been any advances regarding the character encoding not being resolved?

@yaananth
Copy link
Member

Multistage pipelines feature will bring new views which will honor ansii codes, evening when live streaming!

@lindluni
Copy link

While coloring is better with the multistage feature enabled, codes are still dumped in the output of the multistage build

image

@yaananth
Copy link
Member

We support https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit
It's possible the tool is using other specifications, eg: https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit

Which we don't support yet.
However we should be parsing them out.
So, looks like there's some bug there.
Could you send a repo text file or link to where it happens (if it's a public run).
Thanks!

@onlyann
Copy link

onlyann commented Feb 10, 2021

The output from New-AzResourceGroupDeployment -Whatif isn't color coded using the AzurePowershell task from the pipeline web console.
Is it related to this issue?

@stvpalumbo
Copy link

March 19th 2021 - Colors are still not supported properly in the Release Pipeline log viewer. This makes our selenium step so painful to debug...

image

@JoseFMP
Copy link

JoseFMP commented May 25, 2021

Would be great to have the colors supported. Otherwise when you copy the text directly from the output you copy those wrong characters instead of the right colored one's. Even if you lose the colors, I want to copy the right chars!

@DmytroSokhach
Copy link

Close this issue base on this colorful screenshot. :D

@TingluoHuang
could you please share how did you get this screenshot? #1569 (comment)

@Marcus-James-Adams
Copy link

A year on and yet still no response

@jgabyey
Copy link

jgabyey commented Aug 30, 2021

Is there any ETA on a resolution to this issue? When I look at that StdErr portion of the log file at "C:\Packages\Plugins\Microsoft.Compute.CustomScriptExtension\1.10.12\Status" after running a CSE, I've run into the issue where PowerShell7 error messages are also outputting their ANSI escape characters, and it makes debugging a nuisance. See an example below:

{"name":"StdErr","status":"success","code":0,"formattedMessage":{"lang":"en-US","message":"\u001b[91mLog-Output: \u001b[0mC:\\Packages\\Plugins\\Microsoft.Compute.CustomScriptExtension\\1.10.12\\Downloads\\0\\MainScript.ps1:85\r\n\u001b[96mLine |\r\n\u001b[96m 85 | \u001b[0m \u001b[96mLog-Output -output $_ -tag 3 -path $homeDir\u001b[0m\r\n\u001b[96m | \u001b[91m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\u001b[91m\u001b[96m | \u001b[91m2021/08/27 18:38:32.8804 FATAL ERROR\r\n\u001b[96m | \u001b[91mMissing Services \r\n\u001b[0m\r\n"}}]}}]

@smeathers
Copy link

Debugging a Teraform pipeline has lead me here. Like others I can make the logging more readable with the -no-color switch but the lack of colour in the output still reduces the readability of what I'm looking at. It would be a huge help if this could be supported.

@jwedel
Copy link

jwedel commented Jan 25, 2022

Would also appreciate this, as Cypress output in releases windows is pretty much unreadable:
image

@ransagy
Copy link

ransagy commented Jan 30, 2022

Another chime in hope someone from MS responds to this in any way, including "this is backlog/icebox/what".
@bryanmacfarlane @TingluoHuang @yaananth @vijayma @jtpetty - Can anyone point us at the right direction here?

@anatolybolshakov
Copy link
Contributor

Hi everyone, this issue does not seem to be related to the agent itself (since agent does not handle logs view, but only sends them to server) - for the Azure DevOps features/issue reports I would suggest to open a ticket on https://developercommunity.visualstudio.com/search?space=21 to get right eyes on it.

@wwestrop
Copy link

wwestrop commented Feb 2, 2022

For anyone following the thread: https://developercommunity.visualstudio.com/t/Colorful-logs-in-Release-Pipeline-as-wel/1652600

@martingalvan-nordic
Copy link

@jessehouwing why is this closed? I'm still seeing this issue, particularly on the "raw logs" view of Azure CI pipelines.

@github-actions
Copy link

github-actions bot commented Jun 4, 2023

This issue has had no activity in 180 days. Please comment if it is not actually stale

@github-actions github-actions bot added the stale label Jun 4, 2023
@MattJeanes
Copy link

This is still an issue unfortunately

@github-actions github-actions bot removed the stale label Jun 4, 2023
@FreddyAyala
Copy link

Hello, this is still a big issue, are we actively working on it? If you give me access to the internal Repo here in MS I can try to give a hand. Thanks.

@solidcloudio
Copy link

solidcloudio commented Jul 27, 2023

Energizer bunny... Still going..

2023-07-27T03:17:59.8405393Z Resource and property changes are indicated with these symbols: 2023-07-27T03:17:59.8405937Z �[38;5;208m-�[0m Delete 2023-07-27T03:17:59.8406280Z �[38;5;77m+�[0m Create 2023-07-27T03:17:59.8406611Z �[38;5;141m~�[0m Modify 2023-07-27T03:17:59.8407101Z �[38;5;246mx�[0m NoEffect 2023-07-27T03:17:59.8407695Z �[0m=�[0m NoChange 2023-07-27T03:17:59.8408184Z �[38;5;246m*�[0m Ignore

@williamdphillips
Copy link

Any progress on this?

@FreddyAyala
Copy link

Bump, still very important feature missing.

@martingalvan
Copy link

@FreddyAyala I understand you work for Microsoft, correct? Could you solve this internally, or talk to whatever team's responsible for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests