aboutsummaryrefslogtreecommitdiff
path: root/csi.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-06-30 15:43:43 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-06-30 15:44:43 +0000
commit7f65bd1c20d74d196b85761a57f093ab28dc0691 (patch)
treec1a939945b6389c9295f3750184679cfe691908c /csi.c
parentcsi: debug: print 'private' *after* parameters (diff)
csi: '\E[0 q' resets the cursor style to the default, not '\E[2 q'
Also update 'Se' capability in the terminfo, to reflect this.
Diffstat (limited to 'csi.c')
-rw-r--r--csi.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/csi.c b/csi.c
index 62291aa9..3141a79f 100644
--- a/csi.c
+++ b/csi.c
@@ -1446,12 +1446,17 @@ 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 */
- term->cursor_style = CURSOR_BLOCK;
+ case 0: /* blinking block, but we use it to reset to configured default */
+ term->cursor_style = term->default_cursor_style;
+ if (term->default_cursor_blink)
+ term_cursor_blink_enable(term);
+ else
+ term_cursor_blink_disable(term);
break;
- case 2: /* steady block - but can be overriden in footrc */
- term->cursor_style = term->default_cursor_style;
+ case 1: /* blinking block */
+ case 2: /* steady block */
+ term->cursor_style = CURSOR_BLOCK;
break;
case 3: /* blinking underline */
@@ -1469,8 +1474,8 @@ csi_dispatch(struct terminal *term, uint8_t final)
break;
}
- if (param <= 6) {
- if (param == 0 || param & 1)
+ if (param > 0 && param <= 6) {
+ if (param & 1)
term_cursor_blink_enable(term);
else
term_cursor_blink_disable(term);