Author Topic: Lazarus IDE Console output does not show ANSI color escape sequences  (Read 416 times)

Aruna

  • Hero Member
  • *****
  • Posts: 825
[Lazarus IDE] Console output does not show ANSI color escape sequences like it does in a standard shell

Hello everyone,I am having an issue with a console application I am developing in Lazarus. The program uses standard ANSI escape sequences to display colored text in the terminal.When I run the compiled executable directly inside a standard system shell/terminal, the colors render perfectly. See first screenshot attached.

However, when I run the project directly from within the Lazarus IDE (using the Run Output or Debug Console window), the raw escape sequences (like [31m) are printed as plain text characters instead of changing the text color. See second screenshot attached.

I have attached a zip file containing the code. This is not a problem for me but I wanted to know if there is someway to make the lazarus ide Console In/Out window render the escape sequences?

Here are my system details:
OS: Linux Debian
Lazarus Version: 4.99
FPC Version: 3.2.2

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12760
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus IDE Console output does not show ANSI color escape sequences
« Reply #1 on: August 18, 2026, 11:47:39 pm »
Yes, this is a known issue.

There is currently work by a contributor that should improve this.

Also 4.99 (future 5.0) can debug in a real console of your choice (and that will have the terminal support you need): https://forum.lazarus.freepascal.org/index.php/topic,74772.0.html

Aruna

  • Hero Member
  • *****
  • Posts: 825
Re: Lazarus IDE Console output does not show ANSI color escape sequences
« Reply #2 on: August 19, 2026, 02:28:53 am »
Yes, this is a known issue.

There is currently work by a contributor that should improve this.

Also 4.99 (future 5.0) can debug in a real console of your choice (and that will have the terminal support you need): https://forum.lazarus.freepascal.org/index.php/topic,74772.0.html
That works perfectly on my end. I have attached a screenshot for reference. Thank you all so much for your incredible work on this!

 

TinyPortal © 2005-2018