ANSI Escape in Console

Add this URL to your Eclipse Installation to reach this Solution's Update Site.

Learn more...

Details Group Tabs

Hi, is it possible to turn on also ANSI-coloring during build in build console for ROS groovy projects?
For some reason it is not ANSI-colored here (Eclipse 4.4)

Sorry, I don't have an Ubuntu installed (just Win and Fedora).
I have found a VM, and I can try that.

But a quick look at the sources finds this "suspicious" line in catkin_make and catkin_prepare_release:

# force --no-color if stdout is non-interactive
if not sys.stdout.isatty():
    args.no_color = True

Since Eclipse needs to capture its output, it starts the build with the stdio and stderr redirected.
And that makes sys.stdout.isatty() return False (because the Eclipse console is not really a terminal).

It looks like there is no way to get around this without code changes.
But you can just comment these two lines and it should work.

If you are on Windows, the terminal_color.py also needs some fixing, because it assumes that Windows cannot support ANSI escapes (not true):

if os.name in ['nt']:
    disable_ANSI_colors()

The way I would fix ROS "for real" would be by adding a --force-color flag
(or do what most posix apps do: --color=never|always|auto and also honor an environment variable)

Anyway, if commenting the "if not sys.stdout.isatty():" does not work, please let me know, and I will go ahead and try top setup a working ROS environment.

Thank you,
Mihai

I don't know, I have never played with ROS. Let me give it a try, and will get back to you.
Thank you!
Mihai

Just look at picture and try to recall all those ANSI codes...