1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-14 09:37:34 -05:00

Rework handling of the SRM escape sequence.

This sequence (ESC[12l, ESC[12h) enables and disables local echo in
the terminal. We were previously implementing it by gatewaying it
directly through to the local echo facility in the line discipline,
which in turn would pass it on to the terminal it was running in (if
it was Plink).

This seems to be at odds with how other terminals do it: they treat
SRM as its own entirely separate thing, in which the terminal
_emulator_ performs its own echoing of input keypress data,
independently of whether the Unix terminal device (or closest
equivalent) is doing the same thing or not.

Now we're doing it the same way as everyone else (or at least I think
so): the new internal terminal function that the term_keyinput pair
feed to is also implementing SRM-driven local echo as another of its
side effects. One observable effect is that SRM now doesn't interfere
with the termios settings of the terminal it's running in; another is
that the echo now only applies to real keypress data, and not
sequences auto-generated by the terminal.
This commit is contained in:
Simon Tatham
2019-06-17 20:21:06 +01:00
parent 71e42b04a5
commit 9fccb065a6
2 changed files with 54 additions and 19 deletions

View File

@ -123,7 +123,6 @@ struct terminal_tag {
bool cblinker; /* When blinking is the cursor on ? */
bool tblinker; /* When the blinking text is on */
bool blink_is_real; /* Actually blink blinking text */
bool term_echoing; /* Does terminal want local echo? */
bool term_editing; /* Does terminal want local edit? */
int sco_acs, save_sco_acs; /* CSI 10,11,12m -> OEM charset */
bool vt52_bold; /* Force bold on non-bold colours */
@ -148,7 +147,7 @@ struct terminal_tag {
bool in_vbell;
long vbell_end;
bool app_cursor_keys, app_keypad_keys, vt52_mode;
bool repeat_off, cr_lf_return;
bool repeat_off, srm_echo, cr_lf_return;
bool seen_disp_event;
bool big_cursor;
@ -157,7 +156,7 @@ struct terminal_tag {
bool urxvt_extended_mouse;
int mouse_is_down; /* used while tracking mouse buttons */
bool bracketed_paste;
bool bracketed_paste, bracketed_paste_active;
int cset_attr[2];