vt: support ITU-T T.416 color subparameters
The colon ("bit combination 03/10") is a valid character in parameter
substrings. ECMA-48 says:
Each parameter sub-string consists of one or more bit combinations
from 03/00 to 03/10; the bit combinations from 03/00 to 03/09
represent the digits ZERO to NINE; bit combination 03/10 may be used
as a separator in a parameter sub-string, for example, to separate
the fractional part of a decimal number from the integer part of
that number.
To my knowledge, the only codes where 03/10 is actually used as a
separator are the CSI-m SGR sequences. The colon separated format is
superior as an embedded string for software that doesn't wish to link
ncurses terminal database, because terminals that do not support the
requested SGR sequence can safely skip the sub-parameters rather than
misinterpret them as another sequence. Hence, some software have started
using this "modern" format [1]. We should support the colon separated
format as well.
[1] https://github.com/systemd/systemd/commit/6eabe9f2ff48c1b6924724d5afe64e7b661ccdbf
Signed-off-by: Ronan Pigott <ronan@rjp.ie>
Link: https://patch.msgid.link/20260303010701.631022-1-ronan@rjp.ie
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 file changed