I'd like to use ANSI escape sequences to print styled text in Ada.
This is what I've tried:
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Characters.Latin_1; use Ada.Characters.Latin_1;
procedure Main is
begin
-- No ESC character
Put_Line("\033[93mHowdy!\033[0m");
Put_Line("033[31;1;4mHello\033[0m");
-- With ESC character
Put_Line(ESC & "\033[93m" & "Howdy!" & ESC & "\033[0m");
Put_Line(ESC & "033[93m" & "Howdy!" & ESC & "033[0m");
Put_Line(ESC & "033[31;1;4mHello" & ESC & "\033[0m");
Put_Line(ESC & "Howdy"); -- Prints "owdy", i.e. escapes the H
end;
None of them work! Every statement just prints the plaintext.