Open 296951 opened 1 year ago
Looks like a bug, doesn't it? I would try to reproduce in a unit test next.
The new lines are the main part of a workaround that allows ansicolor
to have its work actually passed on to the log file in the presence of timestamper
plugin.
Here's more info.
Is there a way to change the behavior if timestamper is not being used? I still get extra lines even if it is not used.
Is there a way to change the behavior if timestamper is not being used? I still get extra lines even if it is not used.
The determining factor here is whether the other extension (timestamper) is installed, not if it's being used currently (there's no reliable way of checking that).
The determining factor here is whether the other extension (timestamper) is installed, not if it's being used currently (there's no reliable way of checking that).
TIL, bummer.
Could a global env var or a setting configurable on the controller by admins could be a way of controlling this as a workaround?
Or a coordinate fix like you suggested in https://github.com/jenkinsci/ansicolor-plugin/issues/193#issuecomment-657233610?
Will read more about it in the several linked issues... Interested as I'd like to get this plugin running properly on infra.ci.jenkins.io with timestamps activated globally without modifying every pipelines.
With Ansicolor 0.7.5 I don't have any newlines added when the color map is set globally. If I enable it at the job level, the extra newline shows up.
Ansicolor 1.0.0 has:
Based on the description of #218, TERM
was not set for the global config. I thus imagine this change adding TERM
leads to the newlines to be inserted. But maybe it is unrelated.
There is also e603edc33e7ca71ae5f2959e7a26d53d47103def (released in Ansicolor 0.7.3) which apparently cause a newline to be added when there is a decorator timestamper.pipeline.GlobalDecorator
or kubernetes.pipeline.SecretsMasker
.
@tszmytka was the way timestamper works ever fixed? I recall you mentioning that the root problem was indeed how timestamper uses the log.
I am experiencing the exact opposite of this behavior in ANSI Reset codes causing lines to drop the \r returns and run together instead.
What feature do you want to see added?
When I use the ansi color plugin I get an empty log line before and after EVERY ANSI color block in the log.
Is there a way to disable this?
The json block is one ansi color block.
The 4 individual lines are each an ansi color block
Notice all the new lines Below is the same log section with color disabled:
Upstream changes
No response