aboutsummaryrefslogtreecommitdiff
path: root/csi.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-07-22 18:19:27 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-07-22 18:19:27 +0000
commit49034bb759edc0d137783844213677d6db074dcb (patch)
tree28ac64ff9876166eb0984e2fc2a9bf895b704375 /csi.c
parentconf: make cursor's default style configurable (diff)
csi: let CSI 0 q mean "switch to user configured cursor style"
According to the specs, \E[0 q means a blinking block cursor. However, since it also states that \E[1 q *also* is a blinking block cursor, and that it is the default, *and* given that fact that parameter-less CSIs typically means "reset", let's make it mean "reset to the user configured cursor style".
Diffstat (limited to 'csi.c')
-rw-r--r--csi.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/csi.c b/csi.c
index 62ab20cd..9487d8b3 100644
--- a/csi.c
+++ b/csi.c
@@ -929,7 +929,12 @@ csi_dispatch(struct terminal *term, uint8_t final)
case 'q': {
int param = vt_param_get(term, 0, 0);
switch (param) {
- case 0: case 1: /* blinking block */
+ case 0:
+ term->cursor_style = term->default_cursor_style;
+ term->cursor_blinking = false; /* TODO: configurable */
+ break;
+
+ case 1: /* blinking block */
case 2: /* steady block */
term->cursor_style = CURSOR_BLOCK;
break;
@@ -945,7 +950,8 @@ csi_dispatch(struct terminal *term, uint8_t final)
break;
}
- term->cursor_blinking = param == 0 || param & 1;
+ if (param != 0)
+ term->cursor_blinking = param & 1;
if (term->cursor_blinking)
LOG_WARN("unimplemented: blinking cursor");
break;