Recent

Author Topic: Display or Ignore POSIX Colors Escape Code in "Console In/Output" Window  (Read 238 times)

abouchez

  • Jr. Member
  • **
  • Posts: 78
    • Synopse
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

  • Administrator
  • Hero Member
  • *
  • Posts: 8619
  • Debugger - SynEdit - and more
    • wiki
Re: Display or Ignore POSIX Colors Escape Code in "Console In/Output" Window
« Reply #1 on: November 30, 2022, 05:38:17 pm »
Unfortunately not. But patches welcome.

MarkMLl

  • Hero Member
  • *****
  • Posts: 5862
Re: Display or Ignore POSIX Colors Escape Code in "Console In/Output" Window
« Reply #2 on: November 30, 2022, 05:47:03 pm »
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
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8619
  • Debugger - SynEdit - and more
    • wiki
Re: Display or Ignore POSIX Colors Escape Code in "Console In/Output" Window
« Reply #3 on: December 02, 2022, 06:06:59 pm »
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

  • Hero Member
  • *****
  • Posts: 5862
Re: Display or Ignore POSIX Colors Escape Code in "Console In/Output" Window
« Reply #4 on: December 02, 2022, 09:12:54 pm »
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
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018