add cursor hiding libvterm hook

This commit is contained in:
cy384 2020-09-14 19:54:31 -04:00
parent bd24c67224
commit c68d921d6a
3 changed files with 6 additions and 3 deletions

View File

@ -128,6 +128,7 @@ void draw_screen(Rect* r)
// do the cursor if needed
if (con.cursor_state == 1 &&
con.cursor_visible == 1 &&
con.cursor_y >= minRow &&
con.cursor_y <= maxRow &&
con.cursor_x >= minCol &&
@ -300,12 +301,13 @@ int settermprop(VTermProp prop, VTermValue *val, void *user)
case VTERM_PROP_TITLE: // string
set_window_title(con.win, val->string);
return 1;
// TODO: handle more of these, particularly cursor visible and blink
case VTERM_PROP_CURSORVISIBLE: // bool
con.cursor_visible = val->boolean;
return 1;
case VTERM_PROP_ICONNAME: // string
case VTERM_PROP_REVERSE: //bool
case VTERM_PROP_CURSORSHAPE: // number
case VTERM_PROP_MOUSE: // number
case VTERM_PROP_CURSORVISIBLE: // bool
case VTERM_PROP_CURSORBLINK: // bool
case VTERM_PROP_ALTSCREEN: // bool
default:

View File

@ -16,7 +16,7 @@
#define SSH_CHECK(X) rc = (X); if (rc != LIBSSH2_ERROR_NONE) { printf_i("" #X " failed: %s\r\n", libssh2_error_string(rc)); return 0;};
// sinful globals
struct ssheven_console con = { NULL, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL };
struct ssheven_console con = { NULL, 0, 0, 0, 0, 0, 0, 0, 0, 1, NULL, NULL };
struct ssheven_ssh_connection ssh_con = { NULL, NULL, kOTInvalidEndpointRef, NULL, NULL };
enum { WAIT, READ, EXIT } read_thread_command = WAIT;

View File

@ -50,6 +50,7 @@ struct ssheven_console
int cursor_state;
long int last_cursor_blink;
int cursor_visible;
VTerm* vterm;
VTermScreen* vts;