From 267efefdfac114ce3ef4f9cd83be3555c506c226 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 5 Sep 2025 06:15:48 +0000 Subject: [PATCH] Restore default blinking state when restoring default cursor style, from Andrea Alberti. --- input.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/input.c b/input.c index eb6037d4..c33a7cce 100644 --- a/input.c +++ b/input.c @@ -1558,7 +1558,8 @@ input_csi_dispatch(struct input_ctx *ictx) case INPUT_CSI_QUERY_PRIVATE: switch (input_get(ictx, 0, 0, 0)) { case 12: /* cursor blink: 1 = blink, 2 = steady */ - if (s->mode & MODE_CURSOR_BLINKING_SET) + if (s->cstyle != SCREEN_CURSOR_DEFAULT || + s->mode & MODE_CURSOR_BLINKING_SET) n = (s->mode & MODE_CURSOR_BLINKING) ? 1 : 2; else { if (ictx->wp != NULL) @@ -1742,8 +1743,13 @@ input_csi_dispatch(struct input_ctx *ictx) break; case INPUT_CSI_DECSCUSR: n = input_get(ictx, 0, 0, 0); - if (n != -1) - screen_set_cursor_style(n, &s->cstyle, &s->mode); + if (n == -1) + break; + screen_set_cursor_style(n, &s->cstyle, &s->mode); + if (n == 0) { + /* Go back to default blinking state. */ + screen_write_mode_clear(sctx, MODE_CURSOR_BLINKING_SET); + } break; case INPUT_CSI_XDA: n = input_get(ictx, 0, 0, 0);