问题
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!
回答1:
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 this list, 0 , A and B apply to VT100 and up, the remainder to VT220 and up. The VT220 character sets, together with the Portuguese character set are activated by the National Replacement Character controls. The A is a special case, since it is also activated by the VT300-control for British Latin-1 separately from the National Replacement Character controls. ... 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
来源:https://stackoverflow.com/questions/36279015/what-does-x1bb-do