From: Martin Hostettler <textshell@uchuujin.de>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>
Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org,
Nicolas Pitre <nicolas.pitre@linaro.org>,
Adam Borowski <kilobyte@angband.pl>,
Egmont Koblinger <egmont@gmail.com>,
Martin Hostettler <textshell@uchuujin.de>
Subject: [PATCH 4/4] vt: ignore sequences that contain ':' in parameters.
Date: Sat, 15 Dec 2018 15:34:23 +0100 [thread overview]
Message-ID: <20181215143423.4556-5-textshell@uchuujin.de> (raw)
In-Reply-To: <20181215143423.4556-1-textshell@uchuujin.de>
csi sequences can contain subparameters delimited by ':' characters. For
now just ignore the whole sequence in this case. Such sequences are used by
more capable terminal implementations with T.416 high color modes or
extended underline rendition attributes.
Also ignore sequences with private use characters '?', '>', '='
and '>' that are not at the initial position.
Signed-off-by: Martin Hostettler <textshell@uchuujin.de>
---
drivers/tty/vt/vt.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 24cd0e9c037b..0aaa15c723fa 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -1629,9 +1629,9 @@ static void rgb_background(struct vc_data *vc, const struct rgb *c)
/*
* ITU T.416 Higher colour modes. They break the usual properties of SGR codes
- * and thus need to be detected and ignored by hand. Strictly speaking, that
- * standard also wants : rather than ; as separators, contrary to ECMA-48, but
- * no one produces such codes and almost no one accepts them.
+ * and thus need to be detected and ignored by hand. That standard also
+ * wants : rather than ; as separators but sequences containing : are currently
+ * completely ignored by the parser.
*
* Subcommands 3 (CMY) and 4 (CMYK) are so insane there's no point in
* supporting them.
@@ -2259,7 +2259,7 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c)
vc->vc_par[vc->vc_npar] += c - '0';
return;
}
- if (c >= 0x20 && c <= 0x2f) {
+ if (c >= 0x20 && c <= 0x3f) { /* 0x2x, 0x3a and 0x3c - 0x3f */
vc->vc_state = EScsiignore;
return;
}
--
2.11.0
next prev parent reply other threads:[~2018-12-15 14:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-15 14:34 vt: Improve CSI parsing Martin Hostettler
2018-12-15 14:34 ` [PATCH 1/4] vt: refactor vc_ques to allow of other private sequences Martin Hostettler
2018-12-15 14:34 ` [PATCH 2/4] vt: Implement parsing for >, =, < " Martin Hostettler
2018-12-15 14:34 ` [PATCH 3/4] vt: ignore csi sequences with intermediate characters Martin Hostettler
2023-12-14 12:10 ` Jiri Slaby
2024-01-14 15:08 ` Martin Hostettler
2018-12-15 14:34 ` Martin Hostettler [this message]
2019-01-18 12:59 ` vt: Improve CSI parsing Greg Kroah-Hartman
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=20181215143423.4556-5-textshell@uchuujin.de \
--to=textshell@uchuujin.de \
--cc=egmont@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=kilobyte@angband.pl \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nicolas.pitre@linaro.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;
as well as URLs for NNTP newsgroup(s).