From: Andries.Brouwer@cwi.nl
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] omission in video driver
Date: Thu, 4 Apr 2002 13:13:18 GMT [thread overview]
Message-ID: <UTC200204041313.NAA524931.aeb@cwi.nl> (raw)
> if you think a linux KDSBORDER is worthwhile
Maybe mostly fun.
> Ok, so if we feed the above four lines through s/palette/border/g
> then we have an acceptable API?
Yes.
>> [In fact the author of the palette patch did not know the standard
>> for escape sequences, but nobody stopped him.]
> Alas, I too don't know what would be the standard/ANSI escape
> sequences for setting border colours
I meant it differently.
Escape sequences have a certain structure described
in various standards, like ISO 6429 (ECMA 48).
That is useful, it enables applications to parse input
into text and escape sequences without knowing of all
escape sequences precisely what they are supposed to do.
For example, for security one might want to have a filter
that removes the escape sequences (or maybe only the
unrecognized escape sequences) from text written to the
terminal.
Attempt to summarize very briefly:
One has
- single byte codes in 0x00-0x1f, like CR, LF, FF, ESC, BEL, etc.
- single byte codes in 0x80-0x9f, also representable as
ESC followed by a single byte code in 0x40-0x5f.
For example, CSI can be 0x9b or ESC [.
- two byte sequences of the form ESC followed by a byte in 0x60-0x7e.
- sequences that start with CSI, then zero or more parameter bytes
in 0x30-0x3f, then zero or more intermediate bytes in 0x20-0x2f,
then one final byte in 0x40-0x7e.
For example, a typical sequence might be ESC [ rr ; cc H
where rr and cc are sequences of decimal digits, and this
sequence moves the cursor to row rr and column cc.
- finally there sequences that start with an opening delimiter
(e.g. ESC _ or ESC P or ESC ] or ESC ^ or ESC X) and end
with a string terminator (0x9c or ESC \).
The palette setting sequence that Linux uses is
ESC ] P nrrggbb. There is no string terminator here.
So, the structure of the sequence is wrong.
The choice of sequence, probably random, with P for palette,
is also wrong, SGR (set graphics rendition) or DCS (device
control string) would have been more logical choices.
Andries
next reply other threads:[~2002-04-04 13:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-04 13:13 Andries.Brouwer [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-04-03 22:51 [PATCH] omission in video driver Andries.Brouwer
2002-04-01 18:41 Andries.Brouwer
2002-04-03 13:27 ` Paul Gortmaker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=UTC200204041313.NAA524931.aeb@cwi.nl \
--to=andries.brouwer@cwi.nl \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox