
This is a page from an upcoming zine called "The Secret Rules of the Terminal".
To get an email when the zine comes out, sign up for the zine announcements list!

read the transcript!
your terminal emulator has 16 configurable colours
normal | bright | |
---|---|---|
black | 0 | 0 |
red | 1 | 1 |
green | 2 | 2 |
yellow | 3 | 3 |
blue | 4 | 4 |
purple | 5 | 5 |
cyan | 6 | 6 |
white | 7 | 7 |
these are called “ANSI colours”
you can configure them in your terminal emulator’s settings
OR
run a script that prints escape codes to magically set up your colours
https://wzrd.page/scripts
(my favourite way!)
programs can use ANSI colours by printing an escape code
echo -e "\033[34m blue text"
3
means “normal fg colour”
4
means “blue”
the default ANSI colours often have bad contrast
ls --color
often displays directories in ANSI “blue” which can look like this:
[bar of illegibly dark text against a dark background, which says “can you read this?”]
ANSI “yellow” on white also often has bad contrast
“minimum contrast”
Picking ANSI colours which always have good contrast is impossible.
the only real solution is to use a terminal emulator which has a “minimum contrast” feature (like iTerm or kitty) which will fix contrast issues
usually if a program is writing to a pipe, it’ll disable colours
$ grep blah file.txt | less
grep, represented by a box with a smiley face: better turn off colours so that I don’t accidentally show someone `^[[34ntext here]
Saturday Morning Comics!
Want another comic like this in your email every Saturday? Sign up here!