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

Ansicolor leaks colors when a default fore/background is set

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • ansicolor-plugin
    • None
    • Jenkins 2.150.3

      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

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

              Created:
              Updated: