aboutsummaryrefslogtreecommitdiff
path: root/csi.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-07-22 17:44:21 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-07-22 17:44:21 +0000
commit10be7c37ba6ca2dc83ab34cc296bf2618873014e (patch)
tree80b7be918bd5f2e64028ade031e077f3da721386 /csi.c
parentterm: group 'blink' state together in a struct (diff)
csi: prepare for alternative cursor styles
Diffstat (limited to 'csi.c')
-rw-r--r--csi.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/csi.c b/csi.c
index cc23617a..2028df8d 100644
--- a/csi.c
+++ b/csi.c
@@ -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;
}