You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What Operating System are you using (both controller, and any agents involved in the problem)?
Controller: Ubuntu 18.04
Agents: Ubuntu 18.04 in Docker
Reproduction steps
Build a job (multibranch or plain) that uses a Jenkinsfile containing the option ansiColor('xterm') that runs an Ansible script, with the LineNumber plugin installed.
Look at the regular console log, or the full console log if the regular one has been truncated (the LineNumber plugin only works on un-truncated console logs).
Expected Results
I expect to see line numbers and colored text, one line number per line.
Actual Results
Some lines (the output lines for each Ansible task) are concatenated together. In this screenshot, line 13822 is shown appended to 13821, but there are several more lines appended, stretching off the edge of the page:
Here is the plain-text version of the same output (ESC characters not shown):
Here is the html that's being generated (from a different console log file; sorry):
It looks like the code that hides the escape sequences is being thrown off by the addition of line numbers, and ends up hiding the </span></p> that follows the escape sequence being hidden. It only seems to happen with escape sequences at the end of a line, possibly just ESC [ 0m, but that's not proven.
@PenelopeFudd in case you are still struggling with this issue, I found out that you can prevent it from happening by adding a trailing space at the end of the line, e.g.
functionfancy_echo() {
printf"\033[95m%s\033[0m \n""$*">&2# ^ prevent merging lines by ansicolor-plugin
}
fancy_echo Hello world
Jenkins and plugins versions report
Environment
What Operating System are you using (both controller, and any agents involved in the problem)?
Controller: Ubuntu 18.04
Agents: Ubuntu 18.04 in Docker
Reproduction steps
ansiColor('xterm')
that runs an Ansible script, with the LineNumber plugin installed.Expected Results
I expect to see line numbers and colored text, one line number per line.
Actual Results
Some lines (the output lines for each Ansible task) are concatenated together. In this screenshot, line 13822 is shown appended to 13821, but there are several more lines appended, stretching off the edge of the page:

Here is the plain-text version of the same output (ESC characters not shown):

Here is the html that's being generated (from a different console log file; sorry):

It looks like the code that hides the escape sequences is being thrown off by the addition of line numbers, and ends up hiding the
</span></p>
that follows the escape sequence being hidden. It only seems to happen with escape sequences at the end of a line, possibly justESC [ 0m
, but that's not proven.I'd guess the bug might be in ColorConsoleAnnotator.java around line 138 (the hideIfNeeded function):

Hope that helps!
Anything else?
The output in the BlueOcean console does not exhibit the concatenation problem.
The text was updated successfully, but these errors were encountered: