On Wed, Aug 25, 2021 at 12:04:34PM -0400, Douglas Taylor via cctalk wrote:
[...]
In the video on youtube and in my experience the
screen formating codes
seem to be incorrect.? You can see this in the video when a man page is
brought up.? The bolding does not occur.? I get the same result after
installing.? The same with vi, it doesn't work in the video and doesn't
work after installation.? I've tried Teraterm, putty, xterm all with the
same result.? Haven't tried an actual terminal yet.? What was your
experience?
Terminal styling control codes are hit-and-miss even when exclusively using
modern tools. These days, I pretty much exclusively use iTerm2 as my
terminal emulator, which has a bewildering array of compatibility-tweaking
controls to fiddle with, because everything seems to interpret the alleged
standards differently.
When I was relatively new to Linux I just put teminal oddities down to me
not knowing what I was doing and configuring it wrong, but then had the
opportunity to connect a real VT100 to it. "export TERM=vt100" is all
that's
needed, right? There were *loads* of rendering errors, and I got my first
lesson into how well-tested Linux's termcap/terminfo database was.
Fast-forward a quarter-century and our terminal emulators are expected to
handle Unicode, which brings variable-width characters to our fixed-grid
terminal emulators, yet not break too badly if the endpoint is not
Unicode-aware and sends something like Latin-1 instead.
Bold and so on are set via SGR ("Select Graphic Rendition") sequences, and
Wikipedia gives a summary at
<https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters>.
Here's a quick bash one-liner to display them on your terminal:
for i in $(seq 1 127) ; do printf '\033[%dm SGR %d \033[0m\n' $i $i ; done
(Progressively reduce that 127 if your terminal doesn't have scrollback and
you can't see the earlier entries.)
My *terminal* (i.e. iTerm2) supports 1-5, 7, 9, 30-39, 40-49, 90-97 and
100-107, i.e. bold, dim, italic, underline, blink, inverse, strikethrough,
and all of the colours.
However, a lot of useful software includes its own nested terminal emulator,
and support is less good: connecting to a remote server using mosh(1) loses
dim and strikethrough; tmux(1) turns italic into inverse, except on FreeBSD
where it also loses dim, blink and strikethrough and mysteriously gives me
another underline at 21 (probably due to it knowing about double-underline,
but doing a substitution for the benefit of my terminal which doesn't). And
if I use "watch -dc" to run a command repeatedly and highlight the changes,
it only supports the 8 basic colours.
If you test your own systems you may well come up with different results,
because this nested emulation relies on termcap/terminfo databases knowing
about the full capabilities of your terminal (MacOS doesn't include
sitm/ritm for italic, for example) and TERM being set correctly at each
level of nesting, so good luck with that.