csi: *sigh* looks like e.g. neovim doesn't respect Se

I.e. it issues a \E[2 q regardless of what we've configured the
terminfo Se entry to.

So, make \E[2 q mean "the user configured cursor style" (which
defaults to 'block').
This commit is contained in:
Daniel Eklöf 2019-07-22 20:23:29 +02:00
parent 49034bb759
commit 751ac55f64
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 6 additions and 9 deletions

13
csi.c
View file

@ -929,14 +929,12 @@ csi_dispatch(struct terminal *term, uint8_t final)
case 'q': { case 'q': {
int param = vt_param_get(term, 0, 0); int param = vt_param_get(term, 0, 0);
switch (param) { switch (param) {
case 0: case 0: case 1: /* blinking block */
term->cursor_style = term->default_cursor_style; term->cursor_style = CURSOR_BLOCK;
term->cursor_blinking = false; /* TODO: configurable */
break; break;
case 1: /* blinking block */ case 2: /* steady block - but can be overriden in footrc */
case 2: /* steady block */ term->cursor_style = term->default_cursor_style;
term->cursor_style = CURSOR_BLOCK;
break; break;
case 3: /* blinking underline */ case 3: /* blinking underline */
@ -950,8 +948,7 @@ csi_dispatch(struct terminal *term, uint8_t final)
break; break;
} }
if (param != 0) term->cursor_blinking = param == 0 || param & 1;
term->cursor_blinking = param & 1;
if (term->cursor_blinking) if (term->cursor_blinking)
LOG_WARN("unimplemented: blinking cursor"); LOG_WARN("unimplemented: blinking cursor");
break; break;

View file

@ -237,7 +237,7 @@ foot+base|foot base fragment,
vpa=\E[%i%p1%dd, vpa=\E[%i%p1%dd,
E3=\E[3J, E3=\E[3J,
Ms=\E]52;%p1%s;%p2%s\007, Ms=\E]52;%p1%s;%p2%s\007,
Se=\E[0 q, Se=\E[2 q,
Ss=\E[%p1%d q, Ss=\E[%p1%d q,
# XM tells ncurses how to initialize the mouse. The xterm terminfo # XM tells ncurses how to initialize the mouse. The xterm terminfo