diff --git a/protocols/ssh/include/terminal.h b/protocols/ssh/include/terminal.h index dc80d156..087615b2 100644 --- a/protocols/ssh/include/terminal.h +++ b/protocols/ssh/include/terminal.h @@ -419,6 +419,13 @@ void guac_terminal_delta_copy(guac_terminal_delta* delta, int src_row, int src_column, int w, int h); +/** + * Sets a rectangle of character data to the given character value. + */ +void guac_terminal_delta_set_rect(guac_terminal_delta* delta, + int row, int column, int w, int h, + guac_terminal_char* character); + /** * Flushes all pending operations within the given guac_client_delta to the * given guac_terminal. diff --git a/protocols/ssh/src/terminal.c b/protocols/ssh/src/terminal.c index 46e4658b..b975e1e1 100644 --- a/protocols/ssh/src/terminal.c +++ b/protocols/ssh/src/terminal.c @@ -412,18 +412,17 @@ int guac_terminal_copy(guac_terminal* term, int guac_terminal_clear(guac_terminal* term, int row, int col, int rows, int cols, int background_color) { - guac_socket* socket = term->client->socket; - const guac_terminal_color* color = - &guac_terminal_palette[background_color]; + /* Build space */ + guac_terminal_char character; + character.value = ' '; + character.attributes.reverse = false; + character.attributes.background = background_color; /* Fill with color */ - return - guac_protocol_send_rect(socket, GUAC_DEFAULT_LAYER, - col * term->char_width, row * term->char_height, - cols * term->char_width, rows * term->char_height) + guac_terminal_delta_set_rect(term->delta, + row, col, cols, rows, &character); - || guac_protocol_send_cfill(socket, GUAC_COMP_OVER, GUAC_DEFAULT_LAYER, - color->red, color->green, color->blue, 255); + return 0; } @@ -571,6 +570,12 @@ void guac_terminal_delta_copy(guac_terminal_delta* delta, /* STUB */ } +void guac_terminal_delta_set_rect(guac_terminal_delta* delta, + int row, int column, int w, int h, + guac_terminal_char* character) { + /* STUB */ +} + void guac_terminal_delta_flush(guac_terminal_delta* delta, guac_terminal* terminal) { /* STUB */