-\versionid $Id: config.but,v 1.26 2002/02/24 15:25:19 simon Exp $
+\versionid $Id: config.but,v 1.27 2002/03/06 23:04:20 simon Exp $
\C{config} Configuring PuTTY
Application Cursor Keys mode can be turned on and off by the server,
depending on the application. PuTTY allows you to configure the
-initial state, and also allows you to disable application mode
-completely.
+initial state.
+
+You can also disable application cursor keys mode completely, using
+the \q{Features} configuration panel; see
+\k{config-features-application}.
\S{config-appkeypad} Controlling Application Keypad mode
Application keypad mode can be turned on and off by the server,
depending on the application. PuTTY allows you to configure the
-initial state, and also allows you to disable application mode
-completely.
+initial state.
+
+You can also disable application keypad mode completely, using the
+\q{Features} configuration panel; see
+\k{config-features-application}.
\S{config-nethack} Using NetHack keypad mode
in to do so, and how much silent time is required before the
overload feature will deactivate itself.
+\H{config-features} The Features panel
+
+PuTTY's terminal emulation is very highly featured, and can do a lot
+of things under remote server control. Some of these features can
+cause problems due to buggy or strangely configured server
+applications.
+
+The Features configuration panel allows you to disable some of
+PuTTY's more advanced terminal features, in case they cause trouble.
+
+\S{config-features-application} Disabling application keypad and cursor keys
+
+\cfg{winhelp-topic}{features.application}
+
+Application keypad mode (see \k{config-appkeypad}) and application
+cursor keys mode (see \k{config-appcursor}) alter the behaviour of
+the keypad and cursor keys. Some applications enable these modes but
+then do not deal correctly with the modified keys. You can force
+these modes to be permanently disabled no matter what the server
+tries to do.
+
+\S{config-features-resize} Disabling remote terminal resizing
+
+\cfg{winhelp-topic}{features.resize}
+
+PuTTY has the ability to change the terminal's size and position in
+response to commands from the server. If you find PuTTY is doing
+this unexpectedly or inconveniently, you can tell PuTTY not to
+respond to those server commands.
+
+\S{config-features-altscreen} Disabling switching to the alternate screen
+
+\cfg{winhelp-topic}{features.altscreen}
+
+Many terminals, including PuTTY, support an \q{alternate screen}.
+This is the same size as the ordinary terminal screen, but separate.
+Typically a screen-based program such as a text editor might switch
+the terminal to the alternate screen before starting up. Then at the
+end of the run, it switches back to the primary screen, and you see
+the screen contents just as they were before starting the editor.
+
+Some people prefer this not to happen. If you want your editor to
+run in the same screen as the rest of your terminal activity, you
+can disable the alternate screen feature completely.
+
+\S{config-features-retitle} Disabling remote window title changing
+
+\cfg{winhelp-topic}{features.retitle}
+
+PuTTY has the ability to change the window title in response to
+commands from the server. If you find PuTTY is doing this
+unexpectedly or inconveniently, you can tell PuTTY not to respond to
+those server commands.
+
+\S{config-features-dbackspace} Disabling destructive backspace
+
+\cfg{winhelp-topic}{features.dbackspace}
+
+Normally, when PuTTY receives character 127 (^?) from the server, it
+will perform a \q{destructive backspace}: move the cursor one space
+left and delete the character under it. This can apparently cause
+problems in some applications, so PuTTY provides the ability to
+configure character 127 to perform a normal backspace (without
+deleting a character) instead.
+
+\S{config-features-charset} Disabling remote character set
+configuration
+
+\cfg{winhelp-topic}{features.charset}
+
+PuTTY has the ability to change its character set configuration in
+response to commands from the server. Some programs send these
+commands unexpectedly or inconveniently. In particular, BitchX (an
+IRC client) seems to have a habit of reconfiguring the character set
+to something other than the user intended.
+
+If you find that accented characters are not showing up the way you
+expect them to, particularly if you're running BitchX, you could try
+disabling the remote character set configuration commands.
+
\H{config-window} The Window panel
The Window configuration panel allows you to control aspects of the
int funky_type;
int no_applic_c; /* totally disable app cursor keys */
int no_applic_k; /* totally disable app keypad */
+ int no_remote_resize; /* disable remote resizing */
+ int no_alt_screen; /* disable alternate screen */
+ int no_remote_wintitle; /* disable remote retitling */
+ int no_dbackspace; /* disable destructive backspace */
+ int no_remote_charset; /* disable remote charset config */
int app_cursor;
int app_keypad;
int nethack_keypad;
void logfopen(void);
void logfclose(void);
void term_copyall(void);
+void term_reconfig(void);
/*
* Exports from logging.c.
write_setting_i(sesskey, "LinuxFunctionKeys", cfg->funky_type);
write_setting_i(sesskey, "NoApplicationKeys", cfg->no_applic_k);
write_setting_i(sesskey, "NoApplicationCursors", cfg->no_applic_c);
+ write_setting_i(sesskey, "NoRemoteResize", cfg->no_remote_resize);
+ write_setting_i(sesskey, "NoAltScreen", cfg->no_alt_screen);
+ write_setting_i(sesskey, "NoRemoteWinTitle", cfg->no_remote_wintitle);
+ write_setting_i(sesskey, "NoDBackspace", cfg->no_dbackspace);
+ write_setting_i(sesskey, "NoRemoteCharset", cfg->no_remote_charset);
write_setting_i(sesskey, "ApplicationCursorKeys", cfg->app_cursor);
write_setting_i(sesskey, "ApplicationKeypad", cfg->app_keypad);
write_setting_i(sesskey, "NetHackKeypad", cfg->nethack_keypad);
gppi(sesskey, "LinuxFunctionKeys", 0, &cfg->funky_type);
gppi(sesskey, "NoApplicationKeys", 0, &cfg->no_applic_k);
gppi(sesskey, "NoApplicationCursors", 0, &cfg->no_applic_c);
+ gppi(sesskey, "NoRemoteResize", 0, &cfg->no_remote_resize);
+ gppi(sesskey, "NoAltScreen", 0, &cfg->no_alt_screen);
+ gppi(sesskey, "NoRemoteWinTitle", 0, &cfg->no_remote_wintitle);
+ gppi(sesskey, "NoDBackspace", 0, &cfg->no_dbackspace);
+ gppi(sesskey, "NoRemoteCharset", 0, &cfg->no_remote_charset);
gppi(sesskey, "ApplicationCursorKeys", 0, &cfg->app_cursor);
gppi(sesskey, "ApplicationKeypad", 0, &cfg->app_keypad);
gppi(sesskey, "NetHackKeypad", 0, &cfg->nethack_keypad);
}
/*
+ * When the user reconfigures us, we need to check the forbidden-
+ * alternate-screen config option.
+ */
+void term_reconfig(void)
+{
+ if (cfg.no_alt_screen)
+ swap_screen(0);
+ if (cfg.no_remote_charset) {
+ cset_attr[0] = cset_attr[1] = ATTR_ASCII;
+ sco_acs = alt_sco_acs = 0;
+ utf = 0;
+ }
+}
+
+/*
* Clear the scrollback.
*/
void term_clrsb(void)
break;
case 3: /* 80/132 columns */
deselect();
- request_resize(state ? 132 : 80, rows);
+ if (!cfg.no_remote_resize)
+ request_resize(state ? 132 : 80, rows);
reset_132 = state;
break;
case 5: /* reverse video */
case 47: /* alternate screen */
compatibility(OTHER);
deselect();
- swap_screen(state);
+ swap_screen(cfg.no_alt_screen ? 0 : state);
disptop = 0;
break;
case 1000: /* xterm mouse 1 */
switch (esc_args[0]) {
case 0:
case 1:
- set_icon(osc_string);
+ if (!cfg.no_remote_wintitle)
+ set_icon(osc_string);
if (esc_args[0] == 1)
break;
/* fall through: parameter 0 means set both */
case 2:
case 21:
- set_title(osc_string);
+ if (!cfg.no_remote_wintitle)
+ set_title(osc_string);
break;
}
}
curs.x--;
wrapnext = FALSE;
fix_cpos;
- *cpos = (' ' | curr_attr | ATTR_ASCII);
+ if (!cfg.no_dbackspace) /* destructive bksp might be disabled */
+ *cpos = (' ' | curr_attr | ATTR_ASCII);
} else
/* Or normal C0 controls. */
if ((c & -32) == 0 && termstate < DO_CTRLS) {
compatibility(VT100);
power_on();
if (reset_132) {
- request_resize(80, rows);
+ if (!cfg.no_remote_resize)
+ request_resize(80, rows);
reset_132 = 0;
}
fix_cpos;
case ANSI('A', '('):
compatibility(VT100);
- cset_attr[0] = ATTR_GBCHR;
+ if (!cfg.no_remote_charset)
+ cset_attr[0] = ATTR_GBCHR;
break;
case ANSI('B', '('):
compatibility(VT100);
- cset_attr[0] = ATTR_ASCII;
+ if (!cfg.no_remote_charset)
+ cset_attr[0] = ATTR_ASCII;
break;
case ANSI('0', '('):
compatibility(VT100);
- cset_attr[0] = ATTR_LINEDRW;
+ if (!cfg.no_remote_charset)
+ cset_attr[0] = ATTR_LINEDRW;
break;
case ANSI('U', '('):
compatibility(OTHER);
- cset_attr[0] = ATTR_SCOACS;
+ if (!cfg.no_remote_charset)
+ cset_attr[0] = ATTR_SCOACS;
break;
case ANSI('A', ')'):
compatibility(VT100);
- cset_attr[1] = ATTR_GBCHR;
+ if (!cfg.no_remote_charset)
+ cset_attr[1] = ATTR_GBCHR;
break;
case ANSI('B', ')'):
compatibility(VT100);
- cset_attr[1] = ATTR_ASCII;
+ if (!cfg.no_remote_charset)
+ cset_attr[1] = ATTR_ASCII;
break;
case ANSI('0', ')'):
compatibility(VT100);
- cset_attr[1] = ATTR_LINEDRW;
+ if (!cfg.no_remote_charset)
+ cset_attr[1] = ATTR_LINEDRW;
break;
case ANSI('U', ')'):
compatibility(OTHER);
- cset_attr[1] = ATTR_SCOACS;
+ if (!cfg.no_remote_charset)
+ cset_attr[1] = ATTR_SCOACS;
break;
case ANSI('8', '%'): /* Old Linux code */
case ANSI('G', '%'):
compatibility(OTHER);
- utf = 1;
+ if (!cfg.no_remote_charset)
+ utf = 1;
break;
case ANSI('@', '%'):
compatibility(OTHER);
- utf = 0;
+ if (!cfg.no_remote_charset)
+ utf = 0;
break;
}
break;
break;
case 10: /* SCO acs off */
compatibility(SCOANSI);
+ if (cfg.no_remote_charset) break;
sco_acs = 0; break;
case 11: /* SCO acs on */
compatibility(SCOANSI);
+ if (cfg.no_remote_charset) break;
sco_acs = 1; break;
case 12: /* SCO acs on flipped */
compatibility(SCOANSI);
+ if (cfg.no_remote_charset) break;
sco_acs = 2; break;
case 22: /* disable bold */
compatibility2(OTHER, VT220);
if (esc_nargs <= 1
&& (esc_args[0] < 1 || esc_args[0] >= 24)) {
compatibility(VT340TEXT);
- request_resize(cols, def(esc_args[0], 24));
+ if (!cfg.no_remote_resize)
+ request_resize(cols, def(esc_args[0], 24));
deselect();
} else if (esc_nargs >= 1 &&
esc_args[0] >= 1 &&
break;
case 8:
if (esc_nargs >= 3) {
- request_resize(def(esc_args[2], cfg.width),
- def(esc_args[1], cfg.height));
+ if (!cfg.no_remote_resize)
+ request_resize(def(esc_args[2], cfg.width),
+ def(esc_args[1], cfg.height));
}
break;
case 9:
*/
compatibility(VT420);
if (esc_nargs == 1 && esc_args[0] > 0) {
- request_resize(cols, def(esc_args[0], cfg.height));
+ if (!cfg.no_remote_resize)
+ request_resize(cols, def(esc_args[0], cfg.height));
deselect();
}
break;
*/
compatibility(VT340TEXT);
if (esc_nargs <= 1) {
- request_resize(def(esc_args[0], cfg.width), rows);
+ if (!cfg.no_remote_resize)
+ request_resize(def(esc_args[0], cfg.width), rows);
deselect();
}
break;
* Well we should do a soft reset at this point ...
*/
if (!has_compat(VT420) && has_compat(VT100)) {
- if (reset_132)
- request_resize(132, 24);
- else
- request_resize(80, 24);
+ if (!cfg.no_remote_resize) {
+ if (reset_132)
+ request_resize(132, 24);
+ else
+ request_resize(80, 24);
+ }
}
#endif
break;
IDC_KPNORMAL,
IDC_KPAPPLIC,
IDC_KPNH,
- IDC_NOAPPLICK,
- IDC_NOAPPLICC,
IDC_CURSTATIC,
IDC_CURNORMAL,
IDC_CURAPPLIC,
IDC_EDITNO,
terminalpanelend,
+ featurespanelstart,
+ IDC_TITLE_FEATURES,
+ IDC_BOX_FEATURES1,
+ IDC_NOAPPLICK,
+ IDC_NOAPPLICC,
+ IDC_NORESIZE,
+ IDC_NOALTSCREEN,
+ IDC_NOWINTITLE,
+ IDC_NODBACKSPACE,
+ IDC_NOCHARSET,
+ featurespanelend,
+
bellpanelstart,
IDC_TITLE_BELL,
IDC_BOX_BELL1,
case IDC_KPSTATIC:
case IDC_KPNORMAL:
case IDC_KPAPPLIC:
- case IDC_NOAPPLICK:
return "JI(`',`keyboard.appkeypad')";
- case IDC_NOAPPLICC:
case IDC_CURSTATIC:
case IDC_CURNORMAL:
case IDC_CURAPPLIC:
case IDC_CTRLALTKEYS:
return "JI(`',`keyboard.ctrlalt')";
+ case IDC_NOAPPLICK:
+ case IDC_NOAPPLICC:
+ return "JI(`',`features.application')";
+ case IDC_NORESIZE:
+ return "JI(`',`features.resize')";
+ case IDC_NOALTSCREEN:
+ return "JI(`',`features.altscreen')";
+ case IDC_NOWINTITLE:
+ return "JI(`',`features.retitle')";
+ case IDC_NODBACKSPACE:
+ return "JI(`',`features.dbackspace')";
+ case IDC_NOCHARSET:
+ return "JI(`',`features.charset')";
+
case IDC_WRAPMODE:
return "JI(`',`terminal.autowrap')";
case IDC_DECOM:
cfg.funky_type == 5 ? IDC_FUNCSCO : IDC_FUNCTILDE);
CheckDlgButton(hwnd, IDC_NOAPPLICC, cfg.no_applic_c);
CheckDlgButton(hwnd, IDC_NOAPPLICK, cfg.no_applic_k);
+ CheckDlgButton(hwnd, IDC_NORESIZE, cfg.no_remote_resize);
+ CheckDlgButton(hwnd, IDC_NOALTSCREEN, cfg.no_alt_screen);
+ CheckDlgButton(hwnd, IDC_NOWINTITLE, cfg.no_remote_wintitle);
+ CheckDlgButton(hwnd, IDC_NODBACKSPACE, cfg.no_dbackspace);
+ CheckDlgButton(hwnd, IDC_NOCHARSET, cfg.no_remote_charset);
CheckRadioButton(hwnd, IDC_CURNORMAL, IDC_CURAPPLIC,
cfg.app_cursor ? IDC_CURAPPLIC : IDC_CURNORMAL);
CheckRadioButton(hwnd, IDC_KPNORMAL, IDC_KPNH,
endbox(&cp);
}
+ if (panel == featurespanelstart) {
+ /* The Features panel. Accelerators used: [acgoh] uksvatbr */
+ struct ctlpos cp;
+ ctlposinit(&cp, hwnd, 80, 3, 13);
+ bartitle(&cp, "Enabling and disabling advanced terminal features ",
+ IDC_TITLE_FEATURES);
+ beginbox(&cp, NULL, IDC_BOX_FEATURES1);
+ checkbox(&cp, "Disable application c&ursor keys mode", IDC_NOAPPLICC);
+ checkbox(&cp, "Disable application &keypad mode", IDC_NOAPPLICK);
+ checkbox(&cp, "Disable remote-controlled terminal re&sizing",
+ IDC_NORESIZE);
+ checkbox(&cp, "Disable switching to &alternate terminal screen",
+ IDC_NOALTSCREEN);
+ checkbox(&cp, "Disable remote-controlled window &title changing",
+ IDC_NOWINTITLE);
+ checkbox(&cp, "Disable destructive &backspace on server sending ^?",
+ IDC_NODBACKSPACE);
+ checkbox(&cp, "Disable remote-controlled cha&racter set configuration",
+ IDC_NOCHARSET);
+ endbox(&cp);
+ }
+
if (panel == bellpanelstart) {
/* The Bell panel. Accelerators used: [acgoh] bdsm wit */
struct ctlpos cp;
"VT100+", IDC_FUNCVT100P, "SCO", IDC_FUNCSCO, NULL);
endbox(&cp);
beginbox(&cp, "Application keypad settings:", IDC_BOX_KEYBOARD2);
- checkbox(&cp,
- "Application c&ursor keys totally disabled",
- IDC_NOAPPLICC);
radioline(&cp, "Initial state of cu&rsor keys:", IDC_CURSTATIC, 2,
"Normal", IDC_CURNORMAL,
"Application", IDC_CURAPPLIC, NULL);
- checkbox(&cp,
- "Application ke&ypad keys totally disabled",
- IDC_NOAPPLICK);
radioline(&cp, "Initial state of &numeric keypad:", IDC_KPSTATIC,
3, "Normal", IDC_KPNORMAL, "Application", IDC_KPAPPLIC,
"NetHack", IDC_KPNH, NULL);
treeview_insert(&tvfaff, 0, "Terminal");
treeview_insert(&tvfaff, 1, "Keyboard");
treeview_insert(&tvfaff, 1, "Bell");
+ treeview_insert(&tvfaff, 1, "Features");
treeview_insert(&tvfaff, 0, "Window");
treeview_insert(&tvfaff, 1, "Appearance");
treeview_insert(&tvfaff, 1, "Behaviour");
create_controls(hwnd, dlgtype, terminalpanelstart);
if (!strcmp(buffer, "Bell"))
create_controls(hwnd, dlgtype, bellpanelstart);
+ if (!strcmp(buffer, "Features"))
+ create_controls(hwnd, dlgtype, featurespanelstart);
if (!strcmp(buffer, "Window"))
create_controls(hwnd, dlgtype, windowpanelstart);
if (!strcmp(buffer, "Appearance"))
cfg.no_applic_k =
IsDlgButtonChecked(hwnd, IDC_NOAPPLICK);
break;
+ case IDC_NORESIZE:
+ if (HIWORD(wParam) == BN_CLICKED ||
+ HIWORD(wParam) == BN_DOUBLECLICKED)
+ cfg.no_remote_resize =
+ IsDlgButtonChecked(hwnd, IDC_NORESIZE);
+ break;
+ case IDC_NOALTSCREEN:
+ if (HIWORD(wParam) == BN_CLICKED ||
+ HIWORD(wParam) == BN_DOUBLECLICKED)
+ cfg.no_alt_screen =
+ IsDlgButtonChecked(hwnd, IDC_NOALTSCREEN);
+ break;
+ case IDC_NOWINTITLE:
+ if (HIWORD(wParam) == BN_CLICKED ||
+ HIWORD(wParam) == BN_DOUBLECLICKED)
+ cfg.no_remote_wintitle =
+ IsDlgButtonChecked(hwnd, IDC_NOWINTITLE);
+ break;
+ case IDC_NODBACKSPACE:
+ if (HIWORD(wParam) == BN_CLICKED ||
+ HIWORD(wParam) == BN_DOUBLECLICKED)
+ cfg.no_dbackspace =
+ IsDlgButtonChecked(hwnd, IDC_NODBACKSPACE);
+ break;
+ case IDC_NOCHARSET:
+ if (HIWORD(wParam) == BN_CLICKED ||
+ HIWORD(wParam) == BN_DOUBLECLICKED)
+ cfg.no_remote_charset =
+ IsDlgButtonChecked(hwnd, IDC_NOCHARSET);
+ break;
case IDC_ALTF4:
if (HIWORD(wParam) == BN_CLICKED ||
HIWORD(wParam) == BN_DOUBLECLICKED)
cfgtopalette();
init_palette();
+ /* Give terminal a heads-up on miscellaneous stuff */
+ term_reconfig();
+
/* Screen size changed ? */
if (cfg.height != prev_cfg.height ||
cfg.width != prev_cfg.width ||