# # Patch managed by http://www.holgerschurig.de/patcher.html # --- //home/zerodogg/tt/src/config.c~termwidth +++ //home/zerodogg/tt/src/config.c @@ -209,19 +209,35 @@ if (!strcasecmp(arg, "ON")) { SET_BIT(ses->flags, SES_FLAG_WORDWRAP); + ses->force_cols = 0; } else if (!strcasecmp(arg, "OFF")) { DEL_BIT(ses->flags, SES_FLAG_WORDWRAP); + ses->force_cols = 0; } + else if(is_number(arg)) + { + if (atoi(arg) < 10 || atoi(arg) > 500) + { + tintin_printf(ses, "#ERROR: #CONFIG {%s}: Refusing unreasonable width", config_table[index].name); + return NULL; + } + else + { + ses->force_cols = atoi(arg); + } + } else { - tintin_printf(ses, "#SYNTAX: #CONFIG {%s} ", config_table[index].name); + tintin_printf(ses, "#SYNTAX: #CONFIG {%s} ", config_table[index].name); return NULL; } sprintf(str, "%d", index); + init_screen_size(ses); + updatenode_list(ses, config_table[index].name, capitalize(arg), str, LIST_CONFIG); return ses; --- //home/zerodogg/tt/src/session.c~termwidth +++ //home/zerodogg/tt/src/session.c @@ -203,6 +203,15 @@ newsession = calloc(1, sizeof(struct session)); + if(ses->force_cols != 0) + { + newsession->force_cols = ses->force_cols; + } + else + { + newsession->force_cols = 0; + } + newsession->name = strdup(name); newsession->host = strdup(host); newsession->port = strdup(port); --- //home/zerodogg/tt/src/terminal.c~termwidth +++ //home/zerodogg/tt/src/terminal.c @@ -129,6 +129,19 @@ ses->cols = screen.ws_col; } + if(ses->force_cols != 0) + { + if(ses->force_cols > ses->cols) + { + tintin_printf(ses, "#ERROR: WORDWRAP can't be forced to be wider than your actual terminal width. (actual: %d, tried forcing: %d)", ses->cols, ses->force_cols); + ses->force_cols = 0; + } + else + { + ses->cols = ses->force_cols; + } + } + ses->top_row = top; ses->bot_row = ses->rows - bot; --- //home/zerodogg/tt/src/tintin.h~termwidth +++ //home/zerodogg/tt/src/tintin.h @@ -522,6 +522,7 @@ int socket; int telopts; int flags; + int force_cols; char * host; char * port; long long connect_retry;