• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor

      Pipeline:

      node('master'){
          ansiColor('xterm') {
              sh 'echo -e "\033[31mRed\033[0m"'
          }
          wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm']) {
              sh 'echo -e "\033[31mRed\033[0m"'
          }
      }
      node('ansible'){
          ansiColor('xterm') {
              sh 'echo -e "\033[31mRed\033[0m"'
          }
          wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm']) {
              sh 'echo -e "\033[31mRed\033[0m"'
          }
      }
      

      Output:

       

       

       

      I've verified I see ANSI coloring on a freestyle project restricted to the same 'ansible' label

      Shell build step

       

      echo -e "\033[31mRed\033[0m"
      

      Output

       

       

      I've verified this happens on multiple Jenkins instances running 2.138.2. This started happening after the following plugin updates:

      -rw-r--r--. 1 jenkins jenkins  560808 Oct 12 16:54 workflow-cps.jpi
      -rw-r--r--. 1 jenkins jenkins  111622 Oct 12 16:54 workflow-job.jpi
      -rw-r--r--. 1 jenkins jenkins  311324 Oct 12 16:54 ws-cleanup.jpi
      -rw-r--r--. 1 jenkins jenkins  360909 Oct 12 16:54 workflow-support.jpi
      

       

       

          [JENKINS-54133] No ANSI coloring on slave agents in pipeline

          Jesse Glick added a comment -

          Since I see that I have not commented here recently: I do plan to offer a fix for this, I am just trying to deal with higher-priority issues first (JENKINS-54073, then JENKINS-54078, then JENKINS-54081, then this).

          Jesse Glick added a comment - Since I see that I have not commented here recently: I do plan to offer a fix for this, I am just trying to deal with higher-priority issues first ( JENKINS-54073 , then JENKINS-54078 , then JENKINS-54081 , then this).

          Jesse Glick added a comment -

          Just found this code suggesting that note pregeneration is not possible in general (though the common cases could be handled).

          Jesse Glick added a comment - Just found this code suggesting that note pregeneration is not possible in general (though the common cases could be handled).

          Jesse Glick added a comment -

          Filed a PR with the sketch of a fix that currently just handles escape sequences that set a (regular-intensity) foreground color from the colormap, as in the example and the existing test coverage.

          The repository is currently set up to build on Travis CI. If .travis.yml were replaced or supplemented with a Jenkinsfile

          buildPlugin()
          

          then I could mvn incrementals:incrementalify and so PR builds on ci.jenkins.io would automatically publish experimental releases for people to evaluate, via JEP-305. In the meantime, anyone wanting to try this would have to build from sources I think.

          Jesse Glick added a comment - Filed a PR with the sketch of a fix that currently just handles escape sequences that set a (regular-intensity) foreground color from the colormap, as in the example and the existing test coverage. The repository is currently set up to build on Travis CI. If .travis.yml were replaced or supplemented with a Jenkinsfile buildPlugin() then I could mvn incrementals:incrementalify and so PR builds on ci.jenkins.io would automatically publish experimental releases for people to evaluate, via JEP-305 . In the meantime, anyone wanting to try this would have to build from sources I think.

          Jesse Glick added a comment -

          I seem to have succeeded in using ConsoleAnnotatorFactory after all.

          Jesse Glick added a comment - I seem to have succeeded in using ConsoleAnnotatorFactory after all.

          Jesse Glick added a comment -

          All associated PRs merged.

          Jesse Glick added a comment - All associated PRs merged.

          Delivered in pipeline-maven-plugin 3.6.0

          Cyrille Le Clerc added a comment - Delivered in pipeline-maven-plugin 3.6.0

          Jesse Glick added a comment -

          Thus the fixes for ant and pipeline-maven have been released; as well as the hotfix of this issue as originally filed for ansicolor (PRs 128 & 130), though the full fix through rewrite (PR 132) which is merged but not yet released by dnusbaum (and which also requires a post-LTS version of Jenkins core).

          Jesse Glick added a comment - Thus the fixes for ant and pipeline-maven have been released; as well as the hotfix of this issue as originally filed for ansicolor (PRs 128 & 130), though the full fix through rewrite (PR 132) which is merged but not yet released by dnusbaum (and which also requires a post-LTS version of Jenkins core).

          Devin Nusbaum added a comment -

          jglick I just released the full fix for ansicolor in version 0.6.0 of the plugin.

          Devin Nusbaum added a comment - jglick I just released the full fix for ansicolor in version 0.6.0 of the plugin.

          Konstantin Berndikov added a comment - - edited

          I have reproduced the issue with Jenkins 2.332.1 and AnsiColor 1.0.1. The nodes are started with bash and they are using WebSocket connection if that matters. The node executes jar-file which prints color coded messages in log. Everything is fine on master, but no colors or color escape sequences in the output for nodes.

          Jenkins version: 2.332.1
          JDK: openjdk-11+28
          OS: Oracle Linux Server 7.9

          Konstantin Berndikov added a comment - - edited I have reproduced the issue with  Jenkins 2.332.1  and AnsiColor 1.0.1. The nodes are started with bash and they are using WebSocket connection if that matters. The node executes jar-file which prints color coded messages in log. Everything is fine on master, but no colors or color escape sequences in the output for nodes. Jenkins version: 2.332.1 JDK: openjdk-11+28 OS: Oracle Linux Server 7.9

          Jesse Glick added a comment -

          toisen best to file a fresh issue linked to this one with steps to reproduce from scratch.

          Jesse Glick added a comment - toisen best to file a fresh issue linked to this one with steps to reproduce from scratch.

            jglick Jesse Glick
            bspecht Ben Specht
            Votes:
            3 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: