- Aug
- 2,799
- 144
I've been following the other threads in the support forum in regards to the ANSI codes issues.
This is the year 2026.
Would it not be easier to use equates for the ANSI codes?
This seems more maintainable and readable.
Joe
This is the year 2026.
Would it not be easier to use equates for the ANSI codes?
Code:
@SETLOCAL
@ECHO OFF
set _UpOneLine=`^e[A`
set _DownOneLine=`^e[B`
set _SaveCursor=`^e[s`
set _RestoreCursor=`^e[u`
set _UnderLine=`^e[4m`
set _Inverse=`^e[7m`
set _Italic=`^e[3m`
set _Bold=`^e[1m`
set _Reset=`^e[0m`
echo %_Underline``This is underlined.``%_Reset
color bright green on black
echo.
echo %_Inverse``This is inverse.``%_Reset
color bright green on black
echo.
rem Italic does not work in stand-alone tcc.exe
rem Italic does work in Windows Terminal
echo %_Italic``This is italic.``%_Reset
color bright green on black
ENDLOCAL
This seems more maintainable and readable.
Joe