csi: ignore invalid parameters in 'CSI Ps <space> q'

Before this patch, an invalid parameter would not change the cursor
style, but could cause the cursor to start (or stop) blinking.
This commit is contained in:
Daniel Eklöf 2020-05-04 20:19:24 +02:00
parent 921331854a
commit af9e5aef2b
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

14
csi.c
View file

@ -1452,12 +1452,18 @@ csi_dispatch(struct terminal *term, uint8_t final)
case 6: /* steady bar */
term->cursor_style = CURSOR_BAR;
break;
default:
UNHANDLED();
break;
}
if (param == 0 || param & 1)
term_cursor_blink_enable(term);
else
term_cursor_blink_disable(term);
if (param <= 6) {
if (param == 0 || param & 1)
term_cursor_blink_enable(term);
else
term_cursor_blink_disable(term);
}
break;
}