Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-34019

ANSIColor plugin leaks format onto next line's timestamp

    Details

    • Similar Issues:

      Description

      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.

        Attachments

        1. consolelog.png
          consolelog.png
          323 kB
        2. with.png
          with.png
          8 kB
        3. without.png
          without.png
          6 kB

          Issue Links

            Activity

            Hide
            stevengbrown Steven G Brown added a comment - - edited

            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"
            

            Also changed System clock time format so that it no longer uses bold text:

            HH:mm:ss' '
            
            Show
            stevengbrown Steven G Brown added a comment - - edited 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" Also changed System clock time format so that it no longer uses bold text: HH:mm:ss' '
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            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

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - 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
            Hide
            stevengbrown Steven G Brown added a comment -

            Fix released with Timestamper 1.8.6.

            Show
            stevengbrown Steven G Brown added a comment - Fix released with Timestamper 1.8.6.
            Hide
            dankirkd Daniel Kirkdorffer added a comment -

            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

            Show
            dankirkd Daniel Kirkdorffer added a comment - 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
            Hide
            borgstrom Evan Borgstrom added a comment -

            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 }
            
            Show
            borgstrom Evan Borgstrom added a comment - 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 }
            Hide
            dankirkd Daniel Kirkdorffer added a comment -

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

            Show
            dankirkd Daniel Kirkdorffer added a comment - Evan Borgstrom , how does one make that adjustment to Jenkins via the UI?
            Hide
            borgstrom Evan Borgstrom added a comment -

            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.

            Show
            borgstrom Evan Borgstrom added a comment - 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.
            Hide
            dankirkd Daniel Kirkdorffer added a comment -

            I've created a new bug: JENKINS-38573

            Show
            dankirkd Daniel Kirkdorffer added a comment - I've created a new bug: JENKINS-38573
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            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.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - 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.
            Hide
            stevengbrown Steven G Brown added a comment -

            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.
            Show
            stevengbrown Steven G Brown added a comment - 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: Using a ConsoleAnnotatorFactory instead of inserting console notes into the log file. 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.
            Hide
            simonwydooghe Simon Wydooghe added a comment -

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

            Show
            simonwydooghe Simon Wydooghe added a comment - Would be nice to see this fixed if possible...
            Hide
            stevengbrown Steven G Brown added a comment -

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

            Show
            stevengbrown Steven G Brown added a comment - I have provided instructions to reproduce and fix. Pull requests welcome.
            Hide
            jglick Jesse Glick added a comment -

            PR 132 may be a good starting point.

            Show
            jglick Jesse Glick added a comment - PR 132 may be a good starting point.
            Hide
            dnusbaum Devin Nusbaum added a comment -

            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.

            Show
            dnusbaum Devin Nusbaum added a comment - 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.
            Hide
            jglick Jesse Glick added a comment -

            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.

            Show
            jglick Jesse Glick added a comment - 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.
            Hide
            docwhat Christian Höltje added a comment -

            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.

            Show
            docwhat Christian Höltje added a comment - 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.
            Hide
            jglick Jesse Glick added a comment -

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

            Show
            jglick Jesse Glick added a comment - Recheck after PR 137 (unreleased as of this writing).
            Hide
            dnusbaum Devin Nusbaum added a comment -

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

            Show
            dnusbaum Devin Nusbaum added a comment - And if PR 137 doesn't help, it would be worth checking if  PR 147 makes a difference.
            Hide
            nmanos Noam Manos added a comment -

            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

            Show
            nmanos Noam Manos added a comment - 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

              People

              • Assignee:
                Unassigned
                Reporter:
                evildeece Alastair D'Silva
              • Votes:
                4 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated: