Knowledge Bits References I wish I'd already found
Atom · RSS

Articles Tagged with “terminals”

Atom · RSS

Getting a Terminal’s Default Foreground & Background Colors

When using ANSI escape sequences to style text on a terminal, you may need to know exactly what the default foreground & background colors — the ones set with \e[39m and \e[49m — are, as knowing whether the user’s terminal is light-on-dark or dark-on-light can help you pick an appropriate color theme. Fortunately, the escape sequences supported by xterm and compatible terminals include sequences for doing just that.