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

Ansicolor leaks colors when a default fore/background is set

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: ansicolor-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.150.3
    • Similar Issues:

      Description

      The plugin leaks colors when using a custom color map with foreground and background colors set to another color than the Jenkins default.

      When using version 0.6.2 even the output before the first colored output is colored.

      With version 0.5.3 only the output after the first colored output is colored.

      I used the following pipeline script to create the screenshots: 

      echo 'This should not be colored!'
      ansiColor('info')
      {
          echo 'This should be colored!'
      }
      echo 'This should not be colored!'
      

      My color map is defined with the following values:

      Name: info
      Default Background: Yellow
      Default Foreground: Blue
      Black:   black
               black
      Red:     red
               red
      Green:   green
               green
      Yellow:  yellow
               yellow
      Blue:    blue
               blue
      Magenta: magenta
               magenta
      Cyan:    cyan
               cyan
      White:   white
               white

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            adnors Sandro K
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: