Newer
Older
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
dlg_stdcheckbox_handler, I(offsetof(Config,lfhascr)));
ctrl_checkbox(s, "Use background colour to erase screen", 'e',
HELPCTX(terminal_bce),
dlg_stdcheckbox_handler, I(offsetof(Config,bce)));
ctrl_checkbox(s, "Enable blinking text", 'n',
HELPCTX(terminal_blink),
dlg_stdcheckbox_handler, I(offsetof(Config,blinktext)));
ctrl_editbox(s, "Answerback to ^E:", 's', 100,
HELPCTX(terminal_answerback),
dlg_stdeditbox_handler, I(offsetof(Config,answerback)),
I(sizeof(((Config *)0)->answerback)));
s = ctrl_getset(b, "Terminal", "ldisc", "Line discipline options");
ctrl_radiobuttons(s, "Local echo:", 'l', 3,
HELPCTX(terminal_localecho),
dlg_stdradiobutton_handler,I(offsetof(Config,localecho)),
"Auto", I(AUTO),
"Force on", I(FORCE_ON),
"Force off", I(FORCE_OFF), NULL);
ctrl_radiobuttons(s, "Local line editing:", 't', 3,
HELPCTX(terminal_localedit),
dlg_stdradiobutton_handler,I(offsetof(Config,localedit)),
"Auto", I(AUTO),
"Force on", I(FORCE_ON),
"Force off", I(FORCE_OFF), NULL);
s = ctrl_getset(b, "Terminal", "printing", "Remote-controlled printing");
ctrl_combobox(s, "Printer to send ANSI printer output to:", 'p', 100,
HELPCTX(terminal_printing),
printerbox_handler, P(NULL), P(NULL));
/*
* The Terminal/Keyboard panel.
*/
ctrl_settitle(b, "Terminal/Keyboard",
"Options controlling the effects of keys");
s = ctrl_getset(b, "Terminal/Keyboard", "mappings",
"Change the sequences sent by:");
ctrl_radiobuttons(s, "The Backspace key", 'b', 2,
HELPCTX(keyboard_backspace),
dlg_stdradiobutton_handler,
I(offsetof(Config, bksp_is_delete)),
"Control-H", I(0), "Control-? (127)", I(1), NULL);
ctrl_radiobuttons(s, "The Home and End keys", 'e', 2,
HELPCTX(keyboard_homeend),
dlg_stdradiobutton_handler,
I(offsetof(Config, rxvt_homeend)),
"Standard", I(0), "rxvt", I(1), NULL);
ctrl_radiobuttons(s, "The Function keys and keypad", 'f', 3,
HELPCTX(keyboard_funkeys),
dlg_stdradiobutton_handler,
I(offsetof(Config, funky_type)),
"ESC[n~", I(0), "Linux", I(1), "Xterm R6", I(2),
"VT400", I(3), "VT100+", I(4), "SCO", I(5), NULL);
s = ctrl_getset(b, "Terminal/Keyboard", "appkeypad",
"Application keypad settings:");
ctrl_radiobuttons(s, "Initial state of cursor keys:", 'r', 3,
HELPCTX(keyboard_appcursor),
dlg_stdradiobutton_handler,
I(offsetof(Config, app_cursor)),
"Normal", I(0), "Application", I(1), NULL);
ctrl_radiobuttons(s, "Initial state of numeric keypad:", 'n', 3,
HELPCTX(keyboard_appkeypad),
numeric_keypad_handler, P(NULL),
"Normal", I(0), "Application", I(1), "NetHack", I(2),
NULL);
/*
* The Terminal/Bell panel.
*/
ctrl_settitle(b, "Terminal/Bell",
"Options controlling the terminal bell");
s = ctrl_getset(b, "Terminal/Bell", "style", "Set the style of bell");
ctrl_radiobuttons(s, "Action to happen when a bell occurs:", 'b', 1,
HELPCTX(bell_style),
dlg_stdradiobutton_handler, I(offsetof(Config, beep)),
"None (bell disabled)", I(BELL_DISABLED),
"Make default system alert sound", I(BELL_DEFAULT),
"Visual bell (flash window)", I(BELL_VISUAL), NULL);
s = ctrl_getset(b, "Terminal/Bell", "overload",
"Control the bell overload behaviour");
ctrl_checkbox(s, "Bell is temporarily disabled when over-used", 'd',
HELPCTX(bell_overload),
dlg_stdcheckbox_handler, I(offsetof(Config,bellovl)));
ctrl_editbox(s, "Over-use means this many bells...", 'm', 20,
HELPCTX(bell_overload),
dlg_stdeditbox_handler, I(offsetof(Config,bellovl_n)), I(-1));
ctrl_editbox(s, "... in this many seconds", 't', 20,
HELPCTX(bell_overload),
dlg_stdeditbox_handler, I(offsetof(Config,bellovl_t)),
I(-TICKSPERSEC));
ctrl_text(s, "The bell is re-enabled after a few seconds of silence.",
HELPCTX(bell_overload));
ctrl_editbox(s, "Seconds of silence required", 's', 20,
HELPCTX(bell_overload),
dlg_stdeditbox_handler, I(offsetof(Config,bellovl_s)),
I(-TICKSPERSEC));
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
/*
* The Terminal/Features panel.
*/
ctrl_settitle(b, "Terminal/Features",
"Enabling and disabling advanced terminal features");
s = ctrl_getset(b, "Terminal/Features", "main", NULL);
ctrl_checkbox(s, "Disable application cursor keys mode", 'u',
HELPCTX(features_application),
dlg_stdcheckbox_handler, I(offsetof(Config,no_applic_c)));
ctrl_checkbox(s, "Disable application keypad mode", 'k',
HELPCTX(features_application),
dlg_stdcheckbox_handler, I(offsetof(Config,no_applic_k)));
ctrl_checkbox(s, "Disable xterm-style mouse reporting", 'x',
HELPCTX(features_mouse),
dlg_stdcheckbox_handler, I(offsetof(Config,no_mouse_rep)));
ctrl_checkbox(s, "Disable remote-controlled terminal resizing", 's',
HELPCTX(features_resize),
dlg_stdcheckbox_handler,
I(offsetof(Config,no_remote_resize)));
ctrl_checkbox(s, "Disable switching to alternate terminal screen", 'w',
HELPCTX(features_altscreen),
dlg_stdcheckbox_handler, I(offsetof(Config,no_alt_screen)));
ctrl_checkbox(s, "Disable remote-controlled window title changing", 't',
HELPCTX(features_retitle),
dlg_stdcheckbox_handler,
I(offsetof(Config,no_remote_wintitle)));
ctrl_checkbox(s, "Disable remote window title querying (SECURITY)",
'q', HELPCTX(features_qtitle), dlg_stdcheckbox_handler,
I(offsetof(Config,no_remote_qtitle)));
ctrl_checkbox(s, "Disable destructive backspace on server sending ^?",'b',
HELPCTX(features_dbackspace),
dlg_stdcheckbox_handler, I(offsetof(Config,no_dbackspace)));
ctrl_checkbox(s, "Disable remote-controlled character set configuration",
'r', HELPCTX(features_charset), dlg_stdcheckbox_handler,
I(offsetof(Config,no_remote_charset)));
ctrl_checkbox(s, "Disable Arabic text shaping",

Jacob Nevins
committed
'l', HELPCTX(features_arabicshaping), dlg_stdcheckbox_handler,
I(offsetof(Config, arabicshaping)));
ctrl_checkbox(s, "Disable bidirectional text display",

Jacob Nevins
committed
'd', HELPCTX(features_bidi), dlg_stdcheckbox_handler,
I(offsetof(Config, bidi)));
/*
* The Window panel.
*/
str = dupprintf("Options controlling %s's window", appname);
ctrl_settitle(b, "Window", str);
sfree(str);
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
s = ctrl_getset(b, "Window", "size", "Set the size of the window");
ctrl_columns(s, 2, 50, 50);
c = ctrl_editbox(s, "Rows", 'r', 100,
HELPCTX(window_size),
dlg_stdeditbox_handler, I(offsetof(Config,height)),I(-1));
c->generic.column = 0;
c = ctrl_editbox(s, "Columns", 'm', 100,
HELPCTX(window_size),
dlg_stdeditbox_handler, I(offsetof(Config,width)), I(-1));
c->generic.column = 1;
ctrl_columns(s, 1, 100);
s = ctrl_getset(b, "Window", "scrollback",
"Control the scrollback in the window");
ctrl_editbox(s, "Lines of scrollback", 's', 50,
HELPCTX(window_scrollback),
dlg_stdeditbox_handler, I(offsetof(Config,savelines)), I(-1));
ctrl_checkbox(s, "Display scrollbar", 'd',
HELPCTX(window_scrollback),
dlg_stdcheckbox_handler, I(offsetof(Config,scrollbar)));
ctrl_checkbox(s, "Reset scrollback on keypress", 'k',
HELPCTX(window_scrollback),
dlg_stdcheckbox_handler, I(offsetof(Config,scroll_on_key)));
ctrl_checkbox(s, "Reset scrollback on display activity", 'p',
HELPCTX(window_scrollback),
dlg_stdcheckbox_handler, I(offsetof(Config,scroll_on_disp)));
ctrl_checkbox(s, "Push erased text into scrollback", 'e',
HELPCTX(window_erased),
dlg_stdcheckbox_handler,
I(offsetof(Config,erase_to_scrollback)));
/*
* The Window/Appearance panel.
*/
str = dupprintf("Configure the appearance of %s's window", appname);
ctrl_settitle(b, "Window/Appearance", str);
sfree(str);
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
s = ctrl_getset(b, "Window/Appearance", "cursor",
"Adjust the use of the cursor");
ctrl_radiobuttons(s, "Cursor appearance:", NO_SHORTCUT, 3,
HELPCTX(appearance_cursor),
dlg_stdradiobutton_handler,
I(offsetof(Config, cursor_type)),
"Block", 'l', I(0),
"Underline", 'u', I(1),
"Vertical line", 'v', I(2), NULL);
ctrl_checkbox(s, "Cursor blinks", 'b',
HELPCTX(appearance_cursor),
dlg_stdcheckbox_handler, I(offsetof(Config,blink_cur)));
s = ctrl_getset(b, "Window/Appearance", "font",
"Font settings");
ctrl_fontsel(s, "Font used in the terminal window", 'n',
HELPCTX(appearance_font),
dlg_stdfontsel_handler, I(offsetof(Config, font)));
s = ctrl_getset(b, "Window/Appearance", "mouse",
"Adjust the use of the mouse pointer");
ctrl_checkbox(s, "Hide mouse pointer when typing in window", 'p',
HELPCTX(appearance_hidemouse),
dlg_stdcheckbox_handler, I(offsetof(Config,hide_mouseptr)));
s = ctrl_getset(b, "Window/Appearance", "border",
"Adjust the window border");
ctrl_editbox(s, "Gap between text and window edge:", NO_SHORTCUT, 20,
HELPCTX(appearance_border),
dlg_stdeditbox_handler,
I(offsetof(Config,window_border)), I(-1));
/*
* The Window/Behaviour panel.
*/
str = dupprintf("Configure the behaviour of %s's window", appname);
ctrl_settitle(b, "Window/Behaviour", str);
sfree(str);
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
s = ctrl_getset(b, "Window/Behaviour", "title",
"Adjust the behaviour of the window title");
ctrl_editbox(s, "Window title:", 't', 100,
HELPCTX(appearance_title),
dlg_stdeditbox_handler, I(offsetof(Config,wintitle)),
I(sizeof(((Config *)0)->wintitle)));
ctrl_checkbox(s, "Separate window and icon titles", 'i',
HELPCTX(appearance_title),
dlg_stdcheckbox_handler,
I(CHECKBOX_INVERT | offsetof(Config,win_name_always)));
s = ctrl_getset(b, "Window/Behaviour", "main", NULL);
ctrl_checkbox(s, "Warn before closing window", 'w',
HELPCTX(behaviour_closewarn),
dlg_stdcheckbox_handler, I(offsetof(Config,warn_on_close)));
/*
* The Window/Translation panel.
*/
ctrl_settitle(b, "Window/Translation",
"Options controlling character set translation");
s = ctrl_getset(b, "Window/Translation", "trans",
"Character set translation on received data");
ctrl_combobox(s, "Received data assumed to be in which character set:",
'r', 100, HELPCTX(translation_codepage),
codepage_handler, P(NULL), P(NULL));
str = dupprintf("Adjust how %s handles line drawing characters", appname);
s = ctrl_getset(b, "Window/Translation", "linedraw", str);
sfree(str);
ctrl_radiobuttons(s, "Handling of line drawing characters:", NO_SHORTCUT,1,
HELPCTX(translation_linedraw),
dlg_stdradiobutton_handler,
I(offsetof(Config, vtmode)),
"Use Unicode line drawing code points",'u',I(VT_UNICODE),
"Poor man's line drawing (+, - and |)",'p',I(VT_POORMAN),
NULL);
ctrl_checkbox(s, "Copy and paste line drawing characters as lqqqk",'d',
HELPCTX(selection_linedraw),
dlg_stdcheckbox_handler, I(offsetof(Config,rawcnp)));
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
/*
* The Window/Selection panel.
*/
ctrl_settitle(b, "Window/Selection", "Options controlling copy and paste");
s = ctrl_getset(b, "Window/Selection", "mouse",
"Control use of mouse");
ctrl_checkbox(s, "Shift overrides application's use of mouse", 'p',
HELPCTX(selection_shiftdrag),
dlg_stdcheckbox_handler, I(offsetof(Config,mouse_override)));
ctrl_radiobuttons(s,
"Default selection mode (Alt+drag does the other one):",
NO_SHORTCUT, 2,
HELPCTX(selection_rect),
dlg_stdradiobutton_handler,
I(offsetof(Config, rect_select)),
"Normal", 'n', I(0),
"Rectangular block", 'r', I(1), NULL);
s = ctrl_getset(b, "Window/Selection", "charclass",
"Control the select-one-word-at-a-time mode");
ccd = (struct charclass_data *)
ctrl_alloc(b, sizeof(struct charclass_data));
ccd->listbox = ctrl_listbox(s, "Character classes:", 'e',
HELPCTX(selection_charclasses),
charclass_handler, P(ccd));
ccd->listbox->listbox.multisel = 1;
ccd->listbox->listbox.ncols = 4;
ccd->listbox->listbox.percentages = snewn(4, int);
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
ccd->listbox->listbox.percentages[0] = 15;
ccd->listbox->listbox.percentages[1] = 25;
ccd->listbox->listbox.percentages[2] = 20;
ccd->listbox->listbox.percentages[3] = 40;
ctrl_columns(s, 2, 67, 33);
ccd->editbox = ctrl_editbox(s, "Set to class", 't', 50,
HELPCTX(selection_charclasses),
charclass_handler, P(ccd), P(NULL));
ccd->editbox->generic.column = 0;
ccd->button = ctrl_pushbutton(s, "Set", 's',
HELPCTX(selection_charclasses),
charclass_handler, P(ccd));
ccd->button->generic.column = 1;
ctrl_columns(s, 1, 100);
/*
* The Window/Colours panel.
*/
ctrl_settitle(b, "Window/Colours", "Options controlling use of colours");
s = ctrl_getset(b, "Window/Colours", "general",
"General options for colour usage");
ctrl_checkbox(s, "Allow terminal to specify ANSI colours", 'i',
HELPCTX(colours_ansi),
dlg_stdcheckbox_handler, I(offsetof(Config,ansi_colour)));
ctrl_checkbox(s, "Allow terminal to use xterm 256-colour mode", '2',
HELPCTX(colours_xterm256), dlg_stdcheckbox_handler,
I(offsetof(Config,xterm_256_colour)));
ctrl_checkbox(s, "Bolded text is a different colour", 'b',
HELPCTX(colours_bold),
dlg_stdcheckbox_handler, I(offsetof(Config,bold_colour)));
str = dupprintf("Adjust the precise colours %s displays", appname);
s = ctrl_getset(b, "Window/Colours", "adjust", str);
sfree(str);
ctrl_text(s, "Select a colour from the list, and then click the"
" Modify button to change its appearance.",
HELPCTX(colours_config));
ctrl_columns(s, 2, 67, 33);
cd = (struct colour_data *)ctrl_alloc(b, sizeof(struct colour_data));
cd->listbox = ctrl_listbox(s, "Select a colour to adjust:", 'u',
HELPCTX(colours_config), colour_handler, P(cd));
cd->listbox->generic.column = 0;
cd->listbox->listbox.height = 7;
c = ctrl_text(s, "RGB value:", HELPCTX(colours_config));
c->generic.column = 1;
cd->redit = ctrl_editbox(s, "Red", 'r', 50, HELPCTX(colours_config),
colour_handler, P(cd), P(NULL));
cd->redit->generic.column = 1;
cd->gedit = ctrl_editbox(s, "Green", 'n', 50, HELPCTX(colours_config),
colour_handler, P(cd), P(NULL));
cd->gedit->generic.column = 1;
cd->bedit = ctrl_editbox(s, "Blue", 'e', 50, HELPCTX(colours_config),
colour_handler, P(cd), P(NULL));
cd->bedit->generic.column = 1;
cd->button = ctrl_pushbutton(s, "Modify", 'm', HELPCTX(colours_config),
colour_handler, P(cd));
cd->button->generic.column = 1;
ctrl_columns(s, 1, 100);
/*
* The Connection panel. This doesn't show up if we're in a
* non-network utility such as pterm. We tell this by being
* passed a protocol < 0.
if (protocol >= 0) {
ctrl_settitle(b, "Connection", "Options controlling the connection");
s = ctrl_getset(b, "Connection", "keepalive",
"Sending of null packets to keep session active");
ctrl_editbox(s, "Seconds between keepalives (0 to turn off)", 'k', 20,
HELPCTX(connection_keepalive),
dlg_stdeditbox_handler, I(offsetof(Config,ping_interval)),
I(-1));
if (!midsession) {
s = ctrl_getset(b, "Connection", "tcp",
"Low-level TCP connection options");
ctrl_checkbox(s, "Disable Nagle's algorithm (TCP_NODELAY option)",
'n', HELPCTX(connection_nodelay),
dlg_stdcheckbox_handler,
I(offsetof(Config,tcp_nodelay)));
ctrl_checkbox(s, "Enable TCP keepalives (SO_KEEPALIVE option)",
'p', HELPCTX(connection_tcpkeepalive),
dlg_stdcheckbox_handler,
I(offsetof(Config,tcp_keepalives)));
#ifndef NO_IPV6
s = ctrl_getset(b, "Connection", "ipversion",
"Internet protocol version");
ctrl_radiobuttons(s, NULL, NO_SHORTCUT, 3,
HELPCTX(connection_ipversion),
dlg_stdradiobutton_handler,
I(offsetof(Config, addressfamily)),
"Auto", NO_SHORTCUT, I(ADDRTYPE_UNSPEC),
"IPv4", NO_SHORTCUT, I(ADDRTYPE_IPV4),
"IPv6", NO_SHORTCUT, I(ADDRTYPE_IPV6),
NULL);
#endif
}
/*
* A sub-panel Connection/Data, containing options that
* decide on data to send to the server.
*/
if (!midsession) {
ctrl_settitle(b, "Connection/Data", "Data to send to the server");
s = ctrl_getset(b, "Connection/Data", "login",
"Login details");
ctrl_editbox(s, "Auto-login username", 'u', 50,
HELPCTX(connection_username),
dlg_stdeditbox_handler, I(offsetof(Config,username)),
I(sizeof(((Config *)0)->username)));
s = ctrl_getset(b, "Connection/Data", "term",
"Terminal details");
ctrl_editbox(s, "Terminal-type string", 't', 50,
HELPCTX(connection_termtype),
dlg_stdeditbox_handler, I(offsetof(Config,termtype)),
I(sizeof(((Config *)0)->termtype)));
ctrl_editbox(s, "Terminal speeds", 's', 50,
HELPCTX(connection_termspeed),
dlg_stdeditbox_handler, I(offsetof(Config,termspeed)),
I(sizeof(((Config *)0)->termspeed)));
s = ctrl_getset(b, "Connection/Data", "env",
"Environment variables");
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
ctrl_columns(s, 2, 80, 20);
ed = (struct environ_data *)
ctrl_alloc(b, sizeof(struct environ_data));
ed->varbox = ctrl_editbox(s, "Variable", 'v', 60,
HELPCTX(telnet_environ),
environ_handler, P(ed), P(NULL));
ed->varbox->generic.column = 0;
ed->valbox = ctrl_editbox(s, "Value", 'l', 60,
HELPCTX(telnet_environ),
environ_handler, P(ed), P(NULL));
ed->valbox->generic.column = 0;
ed->addbutton = ctrl_pushbutton(s, "Add", 'd',
HELPCTX(telnet_environ),
environ_handler, P(ed));
ed->addbutton->generic.column = 1;
ed->rembutton = ctrl_pushbutton(s, "Remove", 'r',
HELPCTX(telnet_environ),
environ_handler, P(ed));
ed->rembutton->generic.column = 1;
ctrl_columns(s, 1, 100);
ed->listbox = ctrl_listbox(s, NULL, NO_SHORTCUT,
HELPCTX(telnet_environ),
environ_handler, P(ed));
ed->listbox->listbox.height = 3;
ed->listbox->listbox.ncols = 2;
ed->listbox->listbox.percentages = snewn(2, int);
ed->listbox->listbox.percentages[0] = 30;
ed->listbox->listbox.percentages[1] = 70;
}
if (!midsession) {
/*
* The Connection/Proxy panel.
*/
ctrl_settitle(b, "Connection/Proxy",
"Options controlling proxy usage");
s = ctrl_getset(b, "Connection/Proxy", "basics", NULL);
ctrl_radiobuttons(s, "Proxy type:", 't', 3,
HELPCTX(proxy_type),
dlg_stdradiobutton_handler,
I(offsetof(Config, proxy_type)),
"None", I(PROXY_NONE),
"SOCKS 4", I(PROXY_SOCKS4),
"SOCKS 5", I(PROXY_SOCKS5),
"HTTP", I(PROXY_HTTP),
"Telnet", I(PROXY_TELNET),
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
NULL);
ctrl_columns(s, 2, 80, 20);
c = ctrl_editbox(s, "Proxy hostname", 'y', 100,
HELPCTX(proxy_main),
dlg_stdeditbox_handler,
I(offsetof(Config,proxy_host)),
I(sizeof(((Config *)0)->proxy_host)));
c->generic.column = 0;
c = ctrl_editbox(s, "Port", 'p', 100,
HELPCTX(proxy_main),
dlg_stdeditbox_handler,
I(offsetof(Config,proxy_port)),
I(-1));
c->generic.column = 1;
ctrl_columns(s, 1, 100);
ctrl_editbox(s, "Exclude Hosts/IPs", 'e', 100,
HELPCTX(proxy_exclude),
dlg_stdeditbox_handler,
I(offsetof(Config,proxy_exclude_list)),
I(sizeof(((Config *)0)->proxy_exclude_list)));
ctrl_checkbox(s, "Consider proxying local host connections", 'x',
HELPCTX(proxy_exclude),
dlg_stdcheckbox_handler,
I(offsetof(Config,even_proxy_localhost)));
ctrl_radiobuttons(s, "Do DNS name lookup at proxy end:", 'd', 3,
HELPCTX(proxy_dns),
dlg_stdradiobutton_handler,
I(offsetof(Config, proxy_dns)),
"No", I(FORCE_OFF),
"Auto", I(AUTO),
"Yes", I(FORCE_ON), NULL);
ctrl_editbox(s, "Username", 'u', 60,
HELPCTX(proxy_auth),
dlg_stdeditbox_handler,
I(offsetof(Config,proxy_username)),
I(sizeof(((Config *)0)->proxy_username)));
c = ctrl_editbox(s, "Password", 'w', 60,
HELPCTX(proxy_auth),
dlg_stdeditbox_handler,
I(offsetof(Config,proxy_password)),
I(sizeof(((Config *)0)->proxy_password)));
c->editbox.password = 1;
ctrl_editbox(s, "Telnet command", 'm', 100,
HELPCTX(proxy_command),
dlg_stdeditbox_handler,
I(offsetof(Config,proxy_telnet_command)),
I(sizeof(((Config *)0)->proxy_telnet_command)));
}
/*
* The Telnet panel exists in the base config box, and in a
* mid-session reconfig box _if_ we're using Telnet.
*/
if (!midsession || protocol == PROT_TELNET) {
/*
* The Connection/Telnet panel.
*/
ctrl_settitle(b, "Connection/Telnet",
"Options controlling Telnet connections");
s = ctrl_getset(b, "Connection/Telnet", "protocol",
"Telnet protocol adjustments");
if (!midsession) {
ctrl_radiobuttons(s, "Handling of OLD_ENVIRON ambiguity:",
NO_SHORTCUT, 2,
HELPCTX(telnet_oldenviron),
dlg_stdradiobutton_handler,
I(offsetof(Config, rfc_environ)),
"BSD (commonplace)", 'b', I(0),
"RFC 1408 (unusual)", 'f', I(1), NULL);
ctrl_radiobuttons(s, "Telnet negotiation mode:", 't', 2,
HELPCTX(telnet_passive),
dlg_stdradiobutton_handler,
I(offsetof(Config, passive_telnet)),
"Passive", I(1), "Active", I(0), NULL);
}
ctrl_checkbox(s, "Keyboard sends Telnet special commands", 'k',
HELPCTX(telnet_specialkeys),
dlg_stdcheckbox_handler,
I(offsetof(Config,telnet_keyboard)));
ctrl_checkbox(s, "Return key sends Telnet New Line instead of ^M",
'm', HELPCTX(telnet_newline),
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
dlg_stdcheckbox_handler,
I(offsetof(Config,telnet_newline)));
}
if (!midsession) {
/*
* The Connection/Rlogin panel.
*/
ctrl_settitle(b, "Connection/Rlogin",
"Options controlling Rlogin connections");
s = ctrl_getset(b, "Connection/Rlogin", "data",
"Data to send to the server");
ctrl_editbox(s, "Local username:", 'l', 50,
HELPCTX(rlogin_localuser),
dlg_stdeditbox_handler, I(offsetof(Config,localusername)),
I(sizeof(((Config *)0)->localusername)));
}
/*
* All the SSH stuff is omitted in PuTTYtel, or in a reconfig
* when we're not doing SSH.
*/
if (backends[3].name != NULL && (!midsession || protocol == PROT_SSH)) {
/*
* The Connection/SSH panel.
*/
ctrl_settitle(b, "Connection/SSH",
"Options controlling SSH connections");
if (midsession && protcfginfo == 1) {
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
s = ctrl_getset(b, "Connection/SSH", "disclaimer", NULL);
ctrl_text(s, "Nothing on this panel may be reconfigured in mid-"
"session; it is only here so that sub-panels of it can "
"exist without looking strange.", HELPCTX(no_help));
}
if (!midsession) {
s = ctrl_getset(b, "Connection/SSH", "data",
"Data to send to the server");
ctrl_editbox(s, "Remote command:", 'r', 100,
HELPCTX(ssh_command),
dlg_stdeditbox_handler, I(offsetof(Config,remote_cmd)),
I(sizeof(((Config *)0)->remote_cmd)));
s = ctrl_getset(b, "Connection/SSH", "protocol", "Protocol options");
ctrl_checkbox(s, "Don't allocate a pseudo-terminal", 'p',
HELPCTX(ssh_nopty),
dlg_stdcheckbox_handler,
I(offsetof(Config,nopty)));
ctrl_checkbox(s, "Don't start a shell or command at all", 'n',
HELPCTX(ssh_noshell),
dlg_stdcheckbox_handler,
I(offsetof(Config,ssh_no_shell)));
}
if (!midsession || protcfginfo != 1) {
s = ctrl_getset(b, "Connection/SSH", "protocol", "Protocol options");
ctrl_checkbox(s, "Enable compression", 'e',
HELPCTX(ssh_compress),
dlg_stdcheckbox_handler,
I(offsetof(Config,compression)));
}
if (!midsession) {
s = ctrl_getset(b, "Connection/SSH", "protocol", "Protocol options");
ctrl_radiobuttons(s, "Preferred SSH protocol version:", NO_SHORTCUT, 4,
HELPCTX(ssh_protocol),
dlg_stdradiobutton_handler,
I(offsetof(Config, sshprot)),
"1 only", 'l', I(0),
"1", '1', I(1),
"2", '2', I(2),
"2 only", 'y', I(3), NULL);
if (!midsession || protcfginfo != 1) {
s = ctrl_getset(b, "Connection/SSH", "encryption", "Encryption options");
c = ctrl_draglist(s, "Encryption cipher selection policy:", 's',
HELPCTX(ssh_ciphers),
cipherlist_handler, P(NULL));
c->listbox.height = 6;
ctrl_checkbox(s, "Enable legacy use of single-DES in SSH-2", 'i',
HELPCTX(ssh_ciphers),
dlg_stdcheckbox_handler,
I(offsetof(Config,ssh2_des_cbc)));
/*
* The Connection/SSH/Kex panel. (Owing to repeat key
* exchange, this is all meaningful in mid-session _if_
* we're using SSH-2 or haven't decided yet.)
if (protcfginfo != 1) {
ctrl_settitle(b, "Connection/SSH/Kex",
"Options controlling SSH key exchange");
s = ctrl_getset(b, "Connection/SSH/Kex", "main",
"Key exchange algorithm options");
c = ctrl_draglist(s, "Algorithm selection policy:", 's',
HELPCTX(ssh_kexlist),
kexlist_handler, P(NULL));
c->listbox.height = 5;
s = ctrl_getset(b, "Connection/SSH/Kex", "repeat",
"Options controlling key re-exchange");
ctrl_editbox(s, "Max minutes before rekey (0 for no limit)", 't', 20,
HELPCTX(ssh_kex_repeat),
dlg_stdeditbox_handler,
I(offsetof(Config,ssh_rekey_time)),
I(-1));
ctrl_editbox(s, "Max data before rekey (0 for no limit)", 'x', 20,
HELPCTX(ssh_kex_repeat),
dlg_stdeditbox_handler,
I(offsetof(Config,ssh_rekey_data)),
I(16));
ctrl_text(s, "(Use 1M for 1 megabyte, 1G for 1 gigabyte etc)",
HELPCTX(ssh_kex_repeat));
}
if (!midsession) {

Jacob Nevins
committed
/*
* The Connection/SSH/Auth panel.
*/
ctrl_settitle(b, "Connection/SSH/Auth",
"Options controlling SSH authentication");
s = ctrl_getset(b, "Connection/SSH/Auth", "methods",
"Authentication methods");
ctrl_checkbox(s, "Attempt TIS or CryptoCard auth (SSH-1)", 'm',
HELPCTX(ssh_auth_tis),
dlg_stdcheckbox_handler,
I(offsetof(Config,try_tis_auth)));
ctrl_checkbox(s, "Attempt \"keyboard-interactive\" auth (SSH-2)",
'i', HELPCTX(ssh_auth_ki),
dlg_stdcheckbox_handler,
I(offsetof(Config,try_ki_auth)));
s = ctrl_getset(b, "Connection/SSH/Auth", "params",
"Authentication parameters");
ctrl_checkbox(s, "Allow agent forwarding", 'f',
HELPCTX(ssh_auth_agentfwd),
dlg_stdcheckbox_handler, I(offsetof(Config,agentfwd)));
ctrl_checkbox(s, "Allow attempted changes of username in SSH-2", 'u',
HELPCTX(ssh_auth_changeuser),
dlg_stdcheckbox_handler,
I(offsetof(Config,change_username)));
ctrl_filesel(s, "Private key file for authentication:", 'k',
FILTER_KEY_FILES, FALSE, "Select private key file",
HELPCTX(ssh_auth_privkey),
dlg_stdfilesel_handler, I(offsetof(Config, keyfile)));
}
if (!midsession) {
/*
* The Connection/SSH/X11 panel.
*/
ctrl_settitle(b, "Connection/SSH/X11",
"Options controlling SSH X11 forwarding");
s = ctrl_getset(b, "Connection/SSH/X11", "x11", "X11 forwarding");
ctrl_checkbox(s, "Enable X11 forwarding", 'e',
HELPCTX(ssh_tunnels_x11),
dlg_stdcheckbox_handler,I(offsetof(Config,x11_forward)));
ctrl_editbox(s, "X display location", 'x', 50,
HELPCTX(ssh_tunnels_x11),
dlg_stdeditbox_handler, I(offsetof(Config,x11_display)),
I(sizeof(((Config *)0)->x11_display)));
ctrl_radiobuttons(s, "Remote X11 authentication protocol", 'u', 2,
HELPCTX(ssh_tunnels_x11auth),
dlg_stdradiobutton_handler,
I(offsetof(Config, x11_auth)),
"MIT-Magic-Cookie-1", I(X11_MIT),
"XDM-Authorization-1", I(X11_XDM), NULL);
}
/*
* The Tunnels panel _is_ still available in mid-session.
*/
ctrl_settitle(b, "Connection/SSH/Tunnels",
"Options controlling SSH port forwarding");
s = ctrl_getset(b, "Connection/SSH/Tunnels", "portfwd",
"Port forwarding");
ctrl_checkbox(s, "Local ports accept connections from other hosts",'t',
HELPCTX(ssh_tunnels_portfwd_localhost),
dlg_stdcheckbox_handler,
I(offsetof(Config,lport_acceptall)));
ctrl_checkbox(s, "Remote ports do the same (SSH-2 only)", 'p',
HELPCTX(ssh_tunnels_portfwd_localhost),
dlg_stdcheckbox_handler,
I(offsetof(Config,rport_acceptall)));
ctrl_columns(s, 3, 55, 20, 25);
c = ctrl_text(s, "Forwarded ports:", HELPCTX(ssh_tunnels_portfwd));
c->generic.column = COLUMN_FIELD(0,2);
/* You want to select from the list, _then_ hit Remove. So tab order
* should be that way round. */
pfd = (struct portfwd_data *)ctrl_alloc(b,sizeof(struct portfwd_data));
pfd->rembutton = ctrl_pushbutton(s, "Remove", 'r',
HELPCTX(ssh_tunnels_portfwd),
portfwd_handler, P(pfd));
pfd->rembutton->generic.column = 2;
pfd->rembutton->generic.tabdelay = 1;
pfd->listbox = ctrl_listbox(s, NULL, NO_SHORTCUT,
HELPCTX(ssh_tunnels_portfwd),
portfwd_handler, P(pfd));
pfd->listbox->listbox.height = 3;
pfd->listbox->listbox.ncols = 2;
pfd->listbox->listbox.percentages = snewn(2, int);
pfd->listbox->listbox.percentages[0] = 20;
pfd->listbox->listbox.percentages[1] = 80;
ctrl_tabdelay(s, pfd->rembutton);
ctrl_text(s, "Add new forwarded port:", HELPCTX(ssh_tunnels_portfwd));
/* You want to enter source, destination and type, _then_ hit Add.
* Again, we adjust the tab order to reflect this. */
pfd->addbutton = ctrl_pushbutton(s, "Add", 'd',
HELPCTX(ssh_tunnels_portfwd),
portfwd_handler, P(pfd));
pfd->addbutton->generic.column = 2;
pfd->addbutton->generic.tabdelay = 1;
pfd->sourcebox = ctrl_editbox(s, "Source port", 's', 40,
HELPCTX(ssh_tunnels_portfwd),
portfwd_handler, P(pfd), P(NULL));
pfd->sourcebox->generic.column = 0;
pfd->destbox = ctrl_editbox(s, "Destination", 'i', 67,
HELPCTX(ssh_tunnels_portfwd),
portfwd_handler, P(pfd), P(NULL));
pfd->direction = ctrl_radiobuttons(s, NULL, NO_SHORTCUT, 3,
HELPCTX(ssh_tunnels_portfwd),
portfwd_handler, P(pfd),
"Local", 'l', P(NULL),
"Remote", 'm', P(NULL),
"Dynamic", 'y', P(NULL),
NULL);
#ifndef NO_IPV6
pfd->addressfamily =
ctrl_radiobuttons(s, NULL, NO_SHORTCUT, 3,
HELPCTX(ssh_tunnels_portfwd_ipversion),
portfwd_handler, P(pfd),
"Auto", NO_SHORTCUT, I(ADDRTYPE_UNSPEC),
"IPv4", NO_SHORTCUT, I(ADDRTYPE_IPV4),
"IPv6", NO_SHORTCUT, I(ADDRTYPE_IPV6),
NULL);
#endif
ctrl_tabdelay(s, pfd->addbutton);
ctrl_columns(s, 1, 100);
if (!midsession) {
/*
* The Connection/SSH/Bugs panel.
*/
ctrl_settitle(b, "Connection/SSH/Bugs",
"Workarounds for SSH server bugs");
s = ctrl_getset(b, "Connection/SSH/Bugs", "main",
"Detection of known bugs in SSH servers");
ctrl_droplist(s, "Chokes on SSH-1 ignore messages", 'i', 20,
HELPCTX(ssh_bugs_ignore1),
sshbug_handler, I(offsetof(Config,sshbug_ignore1)));
ctrl_droplist(s, "Refuses all SSH-1 password camouflage", 's', 20,
HELPCTX(ssh_bugs_plainpw1),
sshbug_handler, I(offsetof(Config,sshbug_plainpw1)));
ctrl_droplist(s, "Chokes on SSH-1 RSA authentication", 'r', 20,
HELPCTX(ssh_bugs_rsa1),
sshbug_handler, I(offsetof(Config,sshbug_rsa1)));
ctrl_droplist(s, "Miscomputes SSH-2 HMAC keys", 'm', 20,
HELPCTX(ssh_bugs_hmac2),
sshbug_handler, I(offsetof(Config,sshbug_hmac2)));
ctrl_droplist(s, "Miscomputes SSH-2 encryption keys", 'e', 20,
HELPCTX(ssh_bugs_derivekey2),
sshbug_handler, I(offsetof(Config,sshbug_derivekey2)));
ctrl_droplist(s, "Requires padding on SSH-2 RSA signatures", 'p', 20,
HELPCTX(ssh_bugs_rsapad2),
sshbug_handler, I(offsetof(Config,sshbug_rsapad2)));
ctrl_droplist(s, "Misuses the session ID in SSH-2 PK auth", 'n', 20,
HELPCTX(ssh_bugs_pksessid2),
sshbug_handler, I(offsetof(Config,sshbug_pksessid2)));
ctrl_droplist(s, "Handles SSH-2 key re-exchange badly", 'k', 20,
HELPCTX(ssh_bugs_rekey2),
sshbug_handler, I(offsetof(Config,sshbug_rekey2)));