csi: prepare for alternative cursor styles

This commit is contained in:
Daniel Eklöf 2019-07-22 19:44:21 +02:00
parent 428b31f071
commit 10be7c37ba
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 19 additions and 12 deletions

29
csi.c
View file

@ -929,22 +929,27 @@ csi_dispatch(struct terminal *term, uint8_t final)
case 'q': {
int param = vt_param_get(term, 0, 0);
switch (param) {
case 2: /* steady block */
case 0: case 1: /* blinking block */
case 2: /* steady block */
term->cursor_style = CURSOR_BLOCK;
break;
case 0:
case 1: /* blinking block */
case 3: /* blinking underline */
case 4: /* steady underline */
case 5: /* blinking bar */
case 6: /* steady bar */
LOG_WARN("unimplemented: cursor style: %s",
param == 0 || param == 1 ? "blinking block" :
param == 3 ? "blinking underline" :
param == 4 ? "steady underline" :
param == 5 ? "blinking bar" : "steady bar");
case 3: /* blinking underline */
case 4: /* steady underline */
term->cursor_style = CURSOR_UNDERLINE;
LOG_WARN("unimplemented: cursor style: underline");
break;
case 5: /* blinking bar */
case 6: /* steady bar */
term->cursor_style = CURSOR_BAR;
LOG_WARN("unimplemented: cursor style: bar");
break;
}
term->cursor_blinking = param == 0 || param & 1;
if (term->cursor_blinking)
LOG_WARN("unimplemented: blinking cursor");
break;
}

View file

@ -291,6 +291,8 @@ struct terminal {
struct coord cursor;
struct coord saved_cursor;
struct coord alt_saved_cursor;
enum { CURSOR_BLOCK, CURSOR_UNDERLINE, CURSOR_BAR } cursor_style;
bool cursor_blinking;
uint32_t input_serial;
struct {