csi: implement 'civis' (show/hide cursor)

This commit is contained in:
Daniel Eklöf 2019-07-03 14:14:46 +02:00
parent a7a28ff581
commit 5e8c75aa38
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 5 additions and 3 deletions

4
csi.c
View file

@ -567,7 +567,7 @@ csi_dispatch(struct terminal *term, uint8_t final)
break;
case 25:
LOG_WARN("unimplemented: civis");
term->hide_cursor = false;
break;
case 1000:
@ -625,7 +625,7 @@ csi_dispatch(struct terminal *term, uint8_t final)
break;
case 25:
LOG_WARN("unimplemented: civis");
term->hide_cursor = true;
break;
case 1000:

3
main.c
View file

@ -134,7 +134,8 @@ grid_render_update(struct context *c, struct buffer *buf, const struct damage *d
/* Cursor here? */
bool has_cursor
= c->term.cursor.linear == linear_cursor - c->term.grid->offset;
= (!c->term.hide_cursor &&
(c->term.cursor.linear == linear_cursor - c->term.grid->offset));
int x = col * c->term.cell_width;
int y = row * c->term.cell_height;

View file

@ -131,6 +131,7 @@ struct terminal {
pid_t slave;
int ptmx;
bool hide_cursor;
enum decckm decckm;
enum keypad_mode keypad_mode;
bool bracketed_paste;