Forum > Debugger

Display or Ignore POSIX Colors Escape Code in "Console In/Output" Window

(1/1)

abouchez:
I didn't find the answer to this question, for POSIX/Linux.

My app write codes like #27'[1;37m' to change the text color.
It works fine on a regular console: the colors are properly displayed.

In the Lazarus Console In/Ouput window, the control codes are written in the middle of the text, which is annoying.
Is there a way that the color escapes are either ignored or handled as proper color changes, and not displayed on the screen?

Martin_fr:
Unfortunately not. But patches welcome.

MarkMLl:
I did a bit of work in the past on various ways of indicating escape characters etc., but I think some of it got removed possibly because it was rather tenuous when handling UTF-8 etc. in the context of debugger (gdb etc.) output. Any comment Martin?

Quite frankly the IDE's console window is pretty flaky for even unformatted I/O, and I'm not sure that it's worth expanding beyond displaying various encodings. If you want decent output then start the program from your favourite shell session (e.g. Konsole on KDE) and then attach the debugger to it (IDE's run menu).

MarkMLl

Martin_fr:
The issue with what we have now is that is converts the output BEFORE it stores it. IIRC.

However it should store the original, and then display whatever version is being asked for (so the user can switch the display, and all (including old) data will be shown accordingly.

My dream (if ever I manage to squeeze about 96 hours into each single day) is to create a "view" for SynEdit.
So you could have
- text as is
- text with special display for non-printable
- hex
- text + hex
- maybe even basic terminal stuff, like colors
...

But so far my days are hard cut off after 24 hours. :(

MarkMLl:
I've just checked and hex+ASCII etc. and special display of control characters works in the console window, but the "decorations"- line numbers etc.- have for some reason been disabled.

MarkMLl

Navigation

[0] Message Index

Go to full version