Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin parses escape characters but doesn't add CSS - Python specific. #74

Closed
daverickdunn opened this issue Jul 21, 2016 · 9 comments
Closed
Labels
bug ❓ Possibly an ansicolor plugin bug

Comments

@daverickdunn
Copy link

daverickdunn commented Jul 21, 2016

Hi guys,

I've read this thread: #49 and was almost going to comment on it, but for the sake of clarity I'll start a fresh one. I'll try keep it short and to the point.

Plugin is installed, works fine with following:
echo -e "\x1B[31mHello World\e[0m"
Returns:

Hello World

Which is in a span, with beautiful style="color: #CD0000;" applied.

I call a Python script from the same shell using the same escape sequences (I've tried three):
python -u /home/leeroy/jenkins/supersecretscript.py 123 -t

Here, the escape sequences are removed, but there's no HTML or CSS added... :(

To clarify, without ANSIColor the Python output is:

�[92mPass: �[0m Internal network OK

With ANSIColor :

Pass: Internal network OK

But 'Pass' is not colored in the latter, it's just been converted to plain text, it's not even in a span.

Any help is greatly appreciated.

BR,
Rich

@dblock dblock added the bug ❓ Possibly an ansicolor plugin bug label Jul 21, 2016
@dblock
Copy link
Member

dblock commented Jul 21, 2016

This is just a high intensity color that isn't in a released version of this plugin, see #16. I opened #75 to make a release, maybe @ejelly or @qvicksilver can take care of it?

@dblock dblock closed this as completed Jul 21, 2016
@daverickdunn
Copy link
Author

I realised these codes might be causing the issue after I posted, so I changed them to VT100 codes; same issue...

@dblock
Copy link
Member

dblock commented Jul 22, 2016

What did you use? Make that 92 and 31, are you saying that doesn't work?

@daverickdunn
Copy link
Author

daverickdunn commented Jul 23, 2016

After my initial post I realised that anything after 37 (or perhaps 47) might not be supported. So I refactored all of the colors in my script to range of 30 to 37.

The problem is the exact same. It still only removes the escape sequences, it does not replace them with colors. Using these same codes with just 'echo -e' works fine, so I believe this is Python specific.

I call the Python script with '-u' to disable caching, and print with:

sys.out.flush()
sys.out.write(-Some color coded string-)
sys.out.flush()

just to be extra sure....

The user profile that runs the script has its default shell set to /usr/bin/sh.
I've tried using '\e', '\033' and '\x1B'.

@daverickdunn
Copy link
Author

daverickdunn commented Jul 23, 2016

Alright, so I fired up a VM on my home computer and the plugin worked fine for me. There could be another plugin causing the issue, and/or it could be to do with the Jenkins version.

The servers at work probably use an older version of Jenkins, 2.7 (latest stable) I'd guess. I don't have remote access to them right now, so can't check the version until Monday. Are there known issues with this plugin and older versions of Jenkins?

@dblock
Copy link
Member

dblock commented Jul 24, 2016

Hm, no known issues with older Jenkins, as long as the plugin runs it should work. I would debug this next. Lets reopen this issue for now.

@dblock dblock reopened this Jul 24, 2016
@bezda
Copy link

bezda commented Apr 12, 2017

I've had the same problem, updating to 0.5.0 fixed the problem

@dblock
Copy link
Member

dblock commented Apr 12, 2017

@daverickdunn care to try?

@daverickdunn
Copy link
Author

@dblock I forgot all about this! No longer using this plugin I'm afraid...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ❓ Possibly an ansicolor plugin bug
Projects
None yet
Development

No branches or pull requests

3 participants