summaryrefslogtreecommitdiff
path: root/drivers/tty/vt
diff options
context:
space:
mode:
authorMartin Hostettler <textshell@uchuujin.de>2018-12-15 17:34:21 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-18 15:56:41 +0300
commit5445447b62e0cf69a6f8b62df51c1ef6f2cd56fe (patch)
treed330670c4425d26a437498f89acca073d03534d6 /drivers/tty/vt
parent2ff5c5a1dc6e6c502e0a3e49db4e792804e43693 (diff)
downloadlinux-5445447b62e0cf69a6f8b62df51c1ef6f2cd56fe.tar.xz
vt: Implement parsing for >, =, < private sequences.
Private sequences can start with '>', '=' and (in theory) '<'. Implement correct parsing for these. The newly parsable sequences are cleanly ignored as it is customary with terminal emulators. This allows the vt to ignore various sequences used by more capable terminal implementations such as "Secondary Device Attributes", "Tertiary Device Attributes" and various advanced configuration commands that don't have dedicated terminfo entries. Signed-off-by: Martin Hostettler <textshell@uchuujin.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/vt')
-rw-r--r--drivers/tty/vt/vt.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index b59feeaaf02b..ec61f8356245 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -2236,9 +2236,21 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c)
vc->vc_state=ESfunckey;
return;
}
- vc->vc_priv = (c == '?') ? EPdec : EPecma;
- if (vc->vc_priv != EPecma)
+ switch (c) {
+ case '?':
+ vc->vc_priv = EPdec;
+ return;
+ case '>':
+ vc->vc_priv = EPgt;
+ return;
+ case '=':
+ vc->vc_priv = EPeq;
return;
+ case '<':
+ vc->vc_priv = EPlt;
+ return;
+ }
+ vc->vc_priv = EPecma;
/* fall through */
case ESgetpars:
if (c == ';' && vc->vc_npar < NPAR - 1) {
@@ -2252,10 +2264,12 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c)
vc->vc_state = ESnormal;
switch(c) {
case 'h':
- set_mode(vc, 1);
+ if (vc->vc_priv <= EPdec)
+ set_mode(vc, 1);
return;
case 'l':
- set_mode(vc, 0);
+ if (vc->vc_priv <= EPdec)
+ set_mode(vc, 0);
return;
case 'c':
if (vc->vc_priv == EPdec) {