question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Escape chars printed raw in partial console output since 0.7.0

See original GitHub issue

Escape chars printed raw in partial console output since 0.7.0 (works ok in 0.6.3)

Test environment

  • Jenkins Version: 2.222.3
  • AnsiColor Version: 0.7.0
  • Hostsystem: Linux x64

Expected behavior

I would expect the colors/format to appear correctly when/if Jenkins console truncates long output (/console) and not only when the full output is displayed (/consoleFull). ansicolor-0 7 0-consoleFull

Actual behavior

The escape sequences are printed raw on truncated console output. ansicolor-0 7 0 [clicking Full Log link displays the expected behavior]

Steps to reproduce the behavior

Any output that colorizes the output and is truncated by jenkins console doesn’t seem to be working as expected.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:9

github_iconTop GitHub Comments

10reactions
tszmytkacommented, May 26, 2020

Thank you for the report. I had a lot of trouble trying to reproduce this.

Turns out this happens for Jenkins instances which never had a default, global ansicolor options set. My test box had (even if they are all re-set to defaults now) and this prevented me from encountering the bug.

This means that a dirty, short-term solution is to set a global color map and then immediately remove it.

I don’t have much free time at the moment but will try to come up with a permanent fix in the coming days.

4reactions
twz123commented, Jun 8, 2020

Turns out this happens for Jenkins instances which never had a default, global ansicolor options set. My test box had (even if they are all re-set to defaults now) and this prevented me from encountering the bug.

For those of you which use Configuration as Code to manage Jenkins, here’s the config snippet that enables the global color map:

unclassified:
  ansiColorBuildWrapper:
    globalColorMapName: "xterm"

Maybe setting the global color map name to the empty string will also fix the problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Javascript - How to show escape characters in a string?
How can I show escape characters when printing in Javascript? Example: str = "Hello\nWorld"; console.log(str);. Gives:
Read more >
Reference - Nginx.org
Since 0.7.4, the method accepts escaped URIs. r.log( string ): writes a string to the error log on the info level of logging....
Read more >
Keyboard Control - mpv.io
Escaping spaces and other special characters. Keep in mind that the shell will partially parse and mangle the arguments you pass to mpv....
Read more >
Ammonite
Ammonite REPL now prints an additional newline after the output of each command, which should visually separate each command and make it easier...
Read more >
ASCI escape codes shown literally in Jenkins build output
That seems to be for PR 176 which has been released in 0.7.0. From the Jenkins raw console log viewed with vim: That...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found