I'm a Blessed user, and recently, when I tried to find out the contents of the term.bold()
function, I got this output:
\x1b[1m\x1b(B\x1b[m
I understand what \x1b[1m
and \x1b[m
do, but what does \x1b(B
do? I tried printing it, but it doesn't seem to do anything at all.
Thanks in advance!
The control sequence \x1b(B
selects the default character set ASCII. See XTerm Control Sequences:
ESC ( C Designate G0 Character Set (ISO 2022, VT100).Final character C for designating 94-character sets. In thislist, 0 , A and B apply to VT100 and up, the remainder toVT220 and up. The VT220 character sets, together with thePortuguese character set are activated by the NationalReplacement Character controls. The A is a special case,since it is also activated by the VT300-control for BritishLatin-1 separately from the National Replacement Charactercontrols....C = B -> United States (USASCII).
That is provided just in case the terminal was set to some other character set, e.g., line-drawing. Blessed is probably retrieving this as part of \x1b(B\x1b[m
, e.g., in
normal = tigetstr('sgr0')
Further reading:
- How do I get color with VT100?
- VT100.net