diff --git a/ssheven-console.c b/ssheven-console.c index e826a92..a562e99 100644 --- a/ssheven-console.c +++ b/ssheven-console.c @@ -259,6 +259,11 @@ int settermprop(VTermProp prop, VTermValue *val, void *user) return 0; } +void output_callback(const char *s, size_t len, void *user) +{ + ssh_write((char*)s, len); +} + const VTermScreenCallbacks vtscrcb = { .damage = damage, @@ -328,5 +333,7 @@ void console_setup(void) con.vts = vterm_obtain_screen(con.vterm); vterm_screen_reset(con.vts, 1); vterm_screen_set_callbacks(con.vts, &vtscrcb, NULL); + + vterm_output_set_callback(con.vterm, output_callback, NULL); } diff --git a/ssheven.c b/ssheven.c index 9d4c1bb..f8d559f 100644 --- a/ssheven.c +++ b/ssheven.c @@ -192,7 +192,7 @@ void display_about_box(void) DisposeWindow(about); } -void ssh_write(char* buf, int len) +void ssh_write(char* buf, size_t len) { if (read_thread_state == OPEN && read_thread_command != EXIT) { diff --git a/ssheven.h b/ssheven.h index 06e234f..cf25abb 100644 --- a/ssheven.h +++ b/ssheven.h @@ -65,3 +65,5 @@ struct ssheven_ssh_connection }; extern struct ssheven_ssh_connection ssh_con; + +void ssh_write(char* buf, size_t len);