[JIRA] [ansicolor-plugin] (JENKINS-34019) ANSIColor plugin leaks format onto next line's timestamp

48 views
Skip to first unread message

alastair@d-silva.org (JIRA)

unread,
Apr 5, 2016, 1:55:02 AM4/5/16
to jenkinsc...@googlegroups.com
Alastair D'Silva created an issue
 
Jenkins / Bug JENKINS-34019
ANSIColor plugin leaks format onto next line's timestamp
Issue Type: Bug Bug
Assignee: Steven G Brown
Attachments: consolelog.png
Components: ansicolor-plugin, timestamper-plugin
Created: 2016/Apr/05 5:54 AM
Environment: Jenkins 1.650
Priority: Minor Minor
Reporter: Alastair D'Silva

When used with timestamped console output, the formatting from one line sometimes (but not always) leaks over and colors the timestamp on the next line.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

stevengbrown@java.net (JIRA)

unread,
Sep 9, 2016, 4:06:01 AM9/9/16
to jenkinsc...@googlegroups.com
Steven G Brown started work on Bug JENKINS-34019
 
Change By: Steven G Brown
Status: Open In Progress
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

stevengbrown@java.net (JIRA)

unread,
Sep 9, 2016, 4:09:01 AM9/9/16
to jenkinsc...@googlegroups.com
Steven G Brown commented on Bug JENKINS-34019
 
Re: ANSIColor plugin leaks format onto next line's timestamp

Shell script that I used to reproduce this issue:

#!/bin/sh

# Foreground
echo "\033[31mRed Foreground"
echo "\033[0mOff"
# Background
echo "\033[46mCyan Background"
echo "\033[0mOff"
# Bold
echo "\033[1mBold"
echo "\033[0mOff"
# Underline
echo "\033[4mUnderline"
echo "\033[0mOff"
# Double-underline
echo "\033[21mDouble-underline"
echo "\033[0mOff"

stevengbrown@java.net (JIRA)

unread,
Sep 9, 2016, 4:17:01 AM9/9/16
to jenkinsc...@googlegroups.com
Steven G Brown edited a comment on Bug JENKINS-34019
Shell script that I used to reproduce this issue:

{noformat}

#!/bin/sh

# Foreground
echo "\033[31mRed Foreground"
echo "\033[0mOff"
# Background
echo "\033[46mCyan Background"
echo "\033[0mOff"
# Bold
echo "\033[1mBold"
echo "\033[0mOff"
# Underline
echo "\033[4mUnderline"
echo "\033[0mOff"
# Double-underline
echo "\033[21mDouble-underline"
echo "\033[0mOff"
{noformat}

Also changed {{System clock time format}} so that it no longer uses bold text:
{noformat}
HH:mm:ss' '
{noformat}

scm_issue_link@java.net (JIRA)

unread,
Sep 9, 2016, 4:18:01 AM9/9/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Steven Brown
Path:
src/main/java/hudson/plugins/timestamper/annotator/TimestampAnnotatorFactory2.java
src/main/webapp/style.css
http://jenkins-ci.org/commit/timestamper-plugin/c31dc9571d5d1121d3f7e43d81059e0818e58b7a
Log:
JENKINS-34019 When displaying timestamps, ignore AnsiColor plugin styling

stevengbrown@java.net (JIRA)

unread,
Sep 9, 2016, 4:19:02 AM9/9/16
to jenkinsc...@googlegroups.com

Pushed fix for Chrome and Firefox. Not yet tested in Internet Explorer.

stevengbrown@java.net (JIRA)

unread,
Sep 13, 2016, 1:47:01 AM9/13/16
to jenkinsc...@googlegroups.com

stevengbrown@java.net (JIRA)

unread,
Sep 19, 2016, 1:17:01 AM9/19/16
to jenkinsc...@googlegroups.com
Steven G Brown resolved as Fixed
 

Fix released with Timestamper 1.8.6.

Change By: Steven G Brown
Status: In Progress Resolved
Resolution: Fixed

dankirkd@comcast.net (JIRA)

unread,
Sep 27, 2016, 5:25:02 PM9/27/16
to jenkinsc...@googlegroups.com

dankirkd@comcast.net (JIRA)

unread,
Sep 27, 2016, 5:25:02 PM9/27/16
to jenkinsc...@googlegroups.com

dankirkd@comcast.net (JIRA)

unread,
Sep 27, 2016, 5:26:02 PM9/27/16
to jenkinsc...@googlegroups.com
Daniel Kirkdorffer commented on Bug JENKINS-34019
 
Re: ANSIColor plugin leaks format onto next line's timestamp

Is there a way to adjust the colors? I'm not sure I like the new .timestamp style.

It turns the unassuming

into the jarring

evan@borgstrom.ca (JIRA)

unread,
Sep 27, 2016, 7:36:02 PM9/27/16
to jenkinsc...@googlegroups.com

Daniel Kirkdorffer – See my comment here: https://github.com/jenkinsci/timestamper-plugin/commit/c31dc9571d5d1121d3f7e43d81059e0818e58b7a#commitcomment-19199648

In the mean time I worked around this locally for myself by adding to following to my local CSS for Jenkins.

span.timestamp { background: inherit }

dankirkd@comcast.net (JIRA)

unread,
Sep 27, 2016, 7:47:02 PM9/27/16
to jenkinsc...@googlegroups.com

Evan Borgstrom, how does one make that adjustment to Jenkins via the UI?

evan@borgstrom.ca (JIRA)

unread,
Sep 27, 2016, 7:49:01 PM9/27/16
to jenkinsc...@googlegroups.com

Daniel Kirkdorffer We use the jenkins material theme and ship our own CSS, so I just stuck it in there. I'm not sure how you'd apply that value.

dankirkd@comcast.net (JIRA)

unread,
Sep 28, 2016, 1:03:03 PM9/28/16
to jenkinsc...@googlegroups.com

stevengbrown@java.net (JIRA)

unread,
Oct 4, 2016, 10:16:01 PM10/4/16
to jenkinsc...@googlegroups.com
Steven G Brown updated an issue
 
Change By: Steven G Brown
Comment:
Pushed fix for Chrome and Firefox. Not yet tested in Internet Explorer.

stevengbrown@java.net (JIRA)

unread,
Oct 4, 2016, 10:17:01 PM10/4/16
to jenkinsc...@googlegroups.com
Steven G Brown updated an issue
Change By: Steven G Brown
Comment:
Seems to work with IE and Edge.

scm_issue_link@java.net (JIRA)

unread,
Oct 4, 2016, 10:31:06 PM10/4/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Steven Brown
Path:

src/main/resources/hudson/plugins/timestamper/annotator/TimestampAnnotatorFactory2/style.css
http://jenkins-ci.org/commit/timestamper-plugin/6b763a9b72afa21d7f3fe3a8e850612029bac335
Log:
JENKINS-38390 JENKINS-34019 Revert timestamps style added by c31dc95

The style matched the default Jenkins theme, but clashed with custom themes.

stevengbrown@java.net (JIRA)

unread,
Oct 4, 2016, 11:09:03 PM10/4/16
to jenkinsc...@googlegroups.com
Steven G Brown reopened an issue
 

Changes were reverted for Timestamper 1.8.7. Overriding the style works fine for the default Jenkins theme, but clashes with custom themes.

This can be fixed instead within the AnsiColor plugin by:

  1. Using a ConsoleAnnotatorFactory instead of inserting console notes into the log file.
  2. When a style continues to the next line, the ConsoleAnnotatorFactory can insert a closing tag at the end of the line and an opening tag at the beginning of the next line. This prevents the timestamps from being affected.
Change By: Steven G Brown
Resolution: Fixed
Status: Resolved Reopened
Assignee: Steven G Brown

simon@wydooghe.com (JIRA)

unread,
Apr 12, 2018, 7:27:02 AM4/12/18
to jenkinsc...@googlegroups.com
Simon Wydooghe commented on Bug JENKINS-34019
 
Re: ANSIColor plugin leaks format onto next line's timestamp

Would be nice to see this fixed if possible...

This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

StevenGBrown@gmail.com (JIRA)

unread,
Apr 12, 2018, 7:52:02 AM4/12/18
to jenkinsc...@googlegroups.com

I have provided instructions to reproduce and fix. Pull requests welcome.

jglick@cloudbees.com (JIRA)

unread,
Nov 5, 2018, 5:48:04 PM11/5/18
to jenkinsc...@googlegroups.com

PR 132 may be a good starting point.

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

dnusbaum@cloudbees.com (JIRA)

unread,
Nov 14, 2018, 12:44:02 PM11/14/18
to jenkinsc...@googlegroups.com

PR 132 may be a good starting point.

PR 132 was just released in Ansicolor 0.6.0, so it would be good if someone who is seeing this issue can confirm whether that version improves the situation.

jglick@cloudbees.com (JIRA)

unread,
Nov 14, 2018, 12:47:02 PM11/14/18
to jenkinsc...@googlegroups.com

IIUC it was more that switching to a console annotator was expected to make it easier to fix this, as outlined in the note of 2016-10-04.

docwhat@gerf.org (JIRA)

unread,
Jan 7, 2019, 11:36:02 AM1/7/19
to jenkinsc...@googlegroups.com

We have an issue where [0m (aka setaf 0) is being printed to the screen at the end of a line with color and timestamps. This messes up the color for all future lines, though the timestamps themselves are okay.

jglick@cloudbees.com (JIRA)

unread,
Jan 11, 2019, 4:54:02 PM1/11/19
to jenkinsc...@googlegroups.com

Recheck after PR 137 (unreleased as of this writing).

dnusbaum@cloudbees.com (JIRA)

unread,
Jan 11, 2019, 4:58:03 PM1/11/19
to jenkinsc...@googlegroups.com

And if PR 137 doesn't help, it would be worth checking if PR 147 makes a difference.

manosnoam@gmail.com (JIRA)

unread,
May 11, 2020, 4:39:02 AM5/11/20
to jenkinsc...@googlegroups.com

As a workaround, when the timestamper background is white, while the console was set to black in Ansi-Color plugin,

you can use  https://github.com/jazzzz/jenkins-black-console to configure the default CSS to black.

 

All you need is to install Simple Theme Plugin and configure in "Manage Jenkins" this theme:

https://jazzzz.github.io/jenkins-black-console/black-console.css

This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

manosnoam@gmail.com (JIRA)

unread,
May 11, 2020, 4:43:03 AM5/11/20
to jenkinsc...@googlegroups.com
Noam Manos updated an issue
 
Change By: Noam Manos
Environment: Jenkins 1.650 , Jenkins 2.190.3
Reply all
Reply to author
Forward
0 new messages