Here is an idea: how about we drastically modify the way the coloring is done in terminals and in text in general?
Reasoning:
- Right now it is really hard to make the text you write colorful.
- The control flow for the terminal is quite convoluted - most programs stop coloring output if the pipe doesn't lead to tty, so your bash scripts end up looking like a mess.
- External highlighters (or absence thereof) can change the coloring (of your code for example), which may be not desired.
What do we have?
-
ANSI codes. Works only in terminals with color support (which is like 100% of them), works even better with terminals with true color support (which is a bit less than 100% of them). By the way, this gist and many of its forks contain a list of terminals supporting true color.
Example: This
\E[31m
part of text\E[0m
is colored in red.\E
there represents the escape key-code. -
CSS. Web-only system which is fairy good though also fairy complex. The applications are spread a bit wider than just web-pages, because electron exists. The biggest downside being that it directly interacts only with html, and no human writes directly in html.
Example: This
<span style="color:red">
part of text</span>
is colored red.
To be continued...