Re:ANSI escape codes (2019)
by account42 on Wednesday February 03, 2021 @07:34AM
(#26013063)
Depending on what you are doing you can always parse and translate the escape codes to something else for the systems where they are not supported. One advantage of using in-line escape codes in your string is that you can compose multi-colored text and buffer them in whatever strings your language provides.
[ Parent
| on HN ]
Sorry, I don't understand the benefit. Buffer them?
It's clearly harmful to write escape codes in string literals. They are not readable.
The escape code to change any text to red should appear in code exactly once.
This is analogous to HTML inline styles.