char logfilename[FILENAME_MAX];
int logtype;
int hide_mouseptr;
+ char answerback[256];
/* Colour options */
int try_palette;
int bold_colour;
write_setting_i (sesskey, "ComposeKey", cfg->compose_key);
write_setting_i (sesskey, "LocalEcho", cfg->localecho);
write_setting_i (sesskey, "LocalEdit", cfg->localedit);
+ write_setting_s (sesskey, "Answerback", cfg->answerback);
write_setting_i (sesskey, "AlwaysOnTop", cfg->alwaysontop);
write_setting_i (sesskey, "HideMousePtr", cfg->hide_mouseptr);
write_setting_i (sesskey, "CurType", cfg->cursor_type);
gppi (sesskey, "ComposeKey", 0, &cfg->compose_key);
gppi (sesskey, "LocalEcho", LD_BACKEND, &cfg->localecho);
gppi (sesskey, "LocalEdit", LD_BACKEND, &cfg->localedit);
+ gpps (sesskey, "Answerback", "PuTTY", cfg->answerback, sizeof(cfg->answerback));
gppi (sesskey, "AlwaysOnTop", 0, &cfg->alwaysontop);
gppi (sesskey, "HideMousePtr", 0, &cfg->hide_mouseptr);
gppi (sesskey, "CurType", 0, &cfg->cursor_type);
*
* An xterm returns "xterm" (5 characters)
*/
- compatibility(OTHER);
- ldisc_send ("PuTTY", 5);
+ compatibility(ANSIMIN);
+ {
+ char abuf[256], *s, *d;
+ int state=0;
+ for(s=cfg.answerback, d=abuf; *s; s++) {
+ if (state)
+ {
+ if (*s >= 'a' && *s <= 'z')
+ *d++ = (*s - ('a'-1));
+ else if ((*s >='@' && *s<='_') ||
+ *s == '?' || (*s&0x80))
+ *d++ = ('@'^*s);
+ else if (*s == '~')
+ *d++ = '^';
+ state = 0;
+ }
+ else if (*s == '^') {
+ state = 1;
+ }
+ else
+ *d++ = xlat_kbd2tty((unsigned char)*s);
+ }
+ ldisc_send (abuf, d-abuf);
+ }
break;
case '\007':
beep_count++;
IDC_BEEP,
IDC_BCE,
IDC_BLINKTEXT,
+ IDC_ANSWERBACK,
+ IDC_ANSWEREDIT,
IDC_ECHOSTATIC,
IDC_ECHOBACKEND,
IDC_ECHOYES,
CheckRadioButton (hwnd, IDC_EDITBACKEND, IDC_EDITNO,
cfg.localedit == LD_BACKEND ? IDC_EDITBACKEND:
cfg.localedit == LD_YES ? IDC_EDITYES : IDC_EDITNO);
+ SetDlgItemText (hwnd, IDC_ANSWEREDIT, cfg.answerback);
CheckDlgButton (hwnd, IDC_ALWAYSONTOP, cfg.alwaysontop);
CheckDlgButton (hwnd, IDC_SCROLLKEY, cfg.scroll_on_key);
CheckDlgButton (hwnd, IDC_SCROLLDISP, cfg.scroll_on_disp);
}
if (panel == terminalpanelstart) {
- /* The Terminal panel. Accelerators used: [acgo] wdlben ht */
+ /* The Terminal panel. Accelerators used: [acgo] wdlben hts */
struct ctlpos cp;
ctlposinit(&cp, hwnd, 80, 3, 13);
bartitle(&cp, "Options controlling the terminal emulation",
checkbox(&cp, "&Beep enabled", IDC_BEEP);
checkbox(&cp, "Use background colour to &erase screen", IDC_BCE);
checkbox(&cp, "Enable bli&nking text", IDC_BLINKTEXT);
+ multiedit(&cp,
+ "An&swerback to ^E:", IDC_ANSWERBACK,
+ IDC_ANSWEREDIT, 100, NULL);
endbox(&cp);
beginbox(&cp, "Line discipline options",
if (LOWORD(wParam)==IDC_EDITNO) cfg.localedit=LD_NO;
}
break;
+ case IDC_ANSWEREDIT:
+ if (HIWORD(wParam) == EN_CHANGE)
+ GetDlgItemText (hwnd, IDC_ANSWEREDIT, cfg.answerback,
+ sizeof(cfg.answerback)-1);
+ break;
case IDC_ALWAYSONTOP:
if (HIWORD(wParam) == BN_CLICKED ||
HIWORD(wParam) == BN_DOUBLECLICKED)