From 677c3ce6e8a118d074878c041a3fde9c30e9b216 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 28 Jul 2015 16:46:32 -0700 Subject: [PATCH] GUAC-1195: Add "color-scheme" parameter to SSH and telnet. --- src/protocols/ssh/client.c | 11 ++++++++++- src/protocols/telnet/client.c | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/protocols/ssh/client.c b/src/protocols/ssh/client.c index 9eb902fd..3183e22e 100644 --- a/src/protocols/ssh/client.c +++ b/src/protocols/ssh/client.c @@ -56,6 +56,7 @@ const char* GUAC_CLIENT_ARGS[] = { #ifdef ENABLE_SSH_AGENT "enable-agent", #endif + "color-scheme", NULL }; @@ -113,6 +114,14 @@ enum __SSH_ARGS_IDX { IDX_ENABLE_AGENT, #endif + /** + * The name of the color scheme to use. Currently valid color schemes are: + * "black-white", "white-black", "gray-black", and "green-black", each + * following the "foreground-background" pattern. By default, this will be + * "gray-black". + */ + IDX_COLOR_SCHEME, + SSH_ARGS_COUNT }; @@ -174,7 +183,7 @@ int guac_client_init(guac_client* client, int argc, char** argv) { client_data->font_name, client_data->font_size, client->info.optimal_resolution, client->info.optimal_width, client->info.optimal_height, - GUAC_TERMINAL_SCHEME_GRAY_BLACK); + argv[IDX_COLOR_SCHEME]); /* Fail if terminal init failed */ if (client_data->term == NULL) { diff --git a/src/protocols/telnet/client.c b/src/protocols/telnet/client.c index d24a0bf6..dab2bdab 100644 --- a/src/protocols/telnet/client.c +++ b/src/protocols/telnet/client.c @@ -53,6 +53,7 @@ const char* GUAC_CLIENT_ARGS[] = { "password-regex", "font-name", "font-size", + "color-scheme", NULL }; @@ -100,6 +101,14 @@ enum __TELNET_ARGS_IDX { */ IDX_FONT_SIZE, + /** + * The name of the color scheme to use. Currently valid color schemes are: + * "black-white", "white-black", "gray-black", and "green-black", each + * following the "foreground-background" pattern. By default, this will be + * "gray-black". + */ + IDX_COLOR_SCHEME, + TELNET_ARGS_COUNT }; @@ -201,7 +210,7 @@ int guac_client_init(guac_client* client, int argc, char** argv) { client_data->font_name, client_data->font_size, client->info.optimal_resolution, client->info.optimal_width, client->info.optimal_height, - GUAC_TERMINAL_SCHEME_GRAY_BLACK); + argv[IDX_COLOR_SCHEME]); /* Fail if terminal init failed */ if (client_data->term == NULL) {