diff -BrauN /tmp/tt/src/config.c ./src/config.c --- /tmp/tt/src/config.c 2008-01-29 20:44:23.000000000 +0100 +++ ./src/config.c 2008-03-24 00:28:23.000000000 +0100 @@ -75,6 +75,38 @@ return ses; } +DO_CONFIG(config_termwidth) +{ + char str[BUFFER_SIZE]; + + if (!strcasecmp(arg, "OFF")||(is_number(arg) && atoi(arg) <= 0)) + { + ses->force_cols = 0; + } + else if (!is_number(arg)) + { + tintin_printf(ses, "#SYNTAX: #CONFIG {TERMWIDTH} "); + return NULL; + } + else if (atoi(arg) < 10 || atoi(arg) > 500) + { + tintin_printf(ses, "#CONFIG {TERMWIDTH}: REFUSING UNREASONABLE WIDTH NUMBER"); + return NULL; + } + else + { + ses->force_cols = atoi(arg); + } + + init_screen_size(ses); + + sprintf(str, "%d", index); + + updatenode_list(ses, config_table[index].name, capitalize(arg), str, LIST_CONFIG); + + return ses; +} + DO_CONFIG(config_speedwalk) { diff -BrauN /tmp/tt/src/main.c ./src/main.c --- /tmp/tt/src/main.c 2008-01-29 00:50:32.000000000 +0100 +++ ./src/main.c 2008-03-23 23:55:06.000000000 +0100 @@ -302,6 +302,7 @@ printf("\033=\033[?1h"); + do_configure(gts, "{TERMWIDTH} {OFF}"); do_configure(gts, "{SPEEDWALK} {OFF}"); do_configure(gts, "{VERBATIM} {OFF}"); do_configure(gts, "{REPEAT ENTER} {OFF}"); diff -BrauN /tmp/tt/src/session.c ./src/session.c --- /tmp/tt/src/session.c 2007-12-19 15:39:34.000000000 +0100 +++ ./src/session.c 2008-03-24 00:30:22.000000000 +0100 @@ -203,6 +203,11 @@ newsession = calloc(1, sizeof(struct session)); + newsession->force_cols = 0; + if(ses->force_cols != 0) + { + newsession->force_cols = ses->force_cols; + } newsession->name = strdup(name); newsession->host = strdup(host); newsession->port = strdup(port); diff -BrauN /tmp/tt/src/tables.c ./src/tables.c --- /tmp/tt/src/tables.c 2008-01-29 20:55:11.000000000 +0100 +++ ./src/tables.c 2008-03-23 23:58:36.000000000 +0100 @@ -141,6 +141,14 @@ struct config_type config_table[] = { + + { + "TERMWIDTH", + "", + "Force text wrapping shorter than the terminal width", + config_termwidth + }, + { "SPEEDWALK", "Your input is scanned for speedwalk directions", diff -BrauN /tmp/tt/src/terminal.c ./src/terminal.c --- /tmp/tt/src/terminal.c 2007-11-18 16:14:58.000000000 +0100 +++ ./src/terminal.c 2008-03-24 00:18:55.000000000 +0100 @@ -128,6 +128,18 @@ ses->rows = screen.ws_row; ses->cols = screen.ws_col; } + if(ses->force_cols != 0) + { + if(ses->force_cols > ses->cols) + { + tintin_printf(ses, "#ERROR: TERMWIDTH 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; diff -BrauN /tmp/tt/src/tintin.h ./src/tintin.h --- /tmp/tt/src/tintin.h 2008-01-29 20:59:03.000000000 +0100 +++ ./src/tintin.h 2008-03-23 23:55:06.000000000 +0100 @@ -522,6 +522,7 @@ int socket; int telopts; int flags; + int force_cols; char * host; char * port; long long connect_retry; @@ -1025,6 +1026,7 @@ #define __CONFIG_H__ extern DO_COMMAND(do_configure); +extern DO_CONFIG(config_termwidth); extern DO_CONFIG(config_speedwalk); extern DO_CONFIG(config_verbatim); extern DO_CONFIG(config_repeatenter);