Restore default blinking state when restoring default cursor style, from

Andrea Alberti.
This commit is contained in:
nicm
2025-09-05 06:15:48 +00:00
parent 4d83eef756
commit 267efefdfa

12
input.c
View File

@ -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);