1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-17 19:11:00 -05:00

New backend function to disable resizing.

Some protocols such as SUPDUP does not support resizing the terminal.
This commit is contained in:
Lars Brinkhoff
2020-02-14 13:49:56 +01:00
committed by Simon Tatham
parent 269bd7e309
commit e2b0e90c8c
5 changed files with 62 additions and 21 deletions

View File

@ -1472,6 +1472,7 @@ static void clipboard_control(struct controlset *s, const char *label,
void setup_config_box(struct controlbox *b, bool midsession,
int protocol, int protcfginfo)
{
const struct BackendVtable *backvt;
struct controlset *s;
struct sessionsaver_data *ssd;
struct charclass_data *ccd;
@ -1481,6 +1482,7 @@ void setup_config_box(struct controlbox *b, bool midsession,
struct portfwd_data *pfd;
struct manual_hostkey_data *mh;
union control *c;
bool resize_forbidden = false;
char *str;
ssd = (struct sessionsaver_data *)
@ -1864,17 +1866,23 @@ void setup_config_box(struct controlbox *b, bool midsession,
ctrl_settitle(b, "Window", str);
sfree(str);
s = ctrl_getset(b, "Window", "size", "Set the size of the window");
ctrl_columns(s, 2, 50, 50);
c = ctrl_editbox(s, "Columns", 'm', 100,
HELPCTX(window_size),
conf_editbox_handler, I(CONF_width), I(-1));
c->generic.column = 0;
c = ctrl_editbox(s, "Rows", 'r', 100,
HELPCTX(window_size),
conf_editbox_handler, I(CONF_height),I(-1));
c->generic.column = 1;
ctrl_columns(s, 1, 100);
backvt = backend_vt_from_proto(protocol);
if (backvt)
resize_forbidden = (backvt->flags & BACKEND_RESIZE_FORBIDDEN);
if (!resize_forbidden || !midsession) {
s = ctrl_getset(b, "Window", "size", "Set the size of the window");
ctrl_columns(s, 2, 50, 50);
c = ctrl_editbox(s, "Columns", 'm', 100,
HELPCTX(window_size),
conf_editbox_handler, I(CONF_width), I(-1));
c->generic.column = 0;
c = ctrl_editbox(s, "Rows", 'r', 100,
HELPCTX(window_size),
conf_editbox_handler, I(CONF_height),I(-1));
c->generic.column = 1;
ctrl_columns(s, 1, 100);
}
s = ctrl_getset(b, "Window", "scrollback",
"Control the scrollback in the window");