From e3a14e1ad6844b8dd4d4e9bb179080d10d00e451 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 17 Jun 2019 20:49:46 +0100 Subject: [PATCH] Withdraw support for the DECEDM escape sequence. Having decided that the terminal's local echo setting shouldn't be allowed to propagate through to termios, I think the local edit setting shouldn't either. Also, no other terminal emulator I know seems to implement this sequence, and if you enable it, things get very confused in general. I think it's generally better off absent; if somebody turns out to have been using it, then we'll at least be able to find out what it's good for. --- ldisc.c | 6 ++---- putty.h | 1 - terminal.c | 15 --------------- terminal.h | 1 - unix/uxplink.c | 4 ---- windows/winplink.c | 4 ---- 6 files changed, 2 insertions(+), 29 deletions(-) diff --git a/ldisc.c b/ldisc.c index 660e05d6..bd7ffb05 100644 --- a/ldisc.c +++ b/ldisc.c @@ -15,12 +15,10 @@ #define ECHOING (ldisc->localecho == FORCE_ON || \ (ldisc->localecho == AUTO && \ - (backend_ldisc_option_state(ldisc->backend, LD_ECHO) || \ - term_ldisc(ldisc->term, LD_ECHO)))) + (backend_ldisc_option_state(ldisc->backend, LD_ECHO)))) #define EDITING (ldisc->localedit == FORCE_ON || \ (ldisc->localedit == AUTO && \ - (backend_ldisc_option_state(ldisc->backend, LD_EDIT) || \ - term_ldisc(ldisc->term, LD_EDIT)))) + (backend_ldisc_option_state(ldisc->backend, LD_EDIT)))) static void c_write(Ldisc *ldisc, const void *buf, int len) { diff --git a/putty.h b/putty.h index 89ead30f..c7fa53f2 100644 --- a/putty.h +++ b/putty.h @@ -1630,7 +1630,6 @@ void term_invalidate(Terminal *); void term_blink(Terminal *, bool set_cursor); void term_do_paste(Terminal *, const wchar_t *, int); void term_nopaste(Terminal *); -bool term_ldisc(Terminal *, int option); void term_copyall(Terminal *, const int *, int); void term_reconfig(Terminal *, Conf *); void term_request_copy(Terminal *, const int *clipboards, int n_clipboards); diff --git a/terminal.c b/terminal.c index 86ed8f87..dd123d21 100644 --- a/terminal.c +++ b/terminal.c @@ -1341,7 +1341,6 @@ static void power_on(Terminal *term, bool clear) term->alt_save_attr = term->curr_attr = ATTR_DEFAULT; term->curr_truecolour.fg = term->curr_truecolour.bg = optionalrgb_none; term->save_truecolour = term->alt_save_truecolour = term->curr_truecolour; - term->term_editing = false; term->app_cursor_keys = conf_get_bool(term->conf, CONF_app_cursor); term->app_keypad_keys = conf_get_bool(term->conf, CONF_app_keypad); term->use_bce = conf_get_bool(term->conf, CONF_bce); @@ -2639,11 +2638,6 @@ static void toggle_mode(Terminal *term, int mode, int query, bool state) case 8: /* DECARM: auto key repeat */ term->repeat_off = !state; break; - case 10: /* DECEDM: set local edit mode */ - term->term_editing = state; - if (term->ldisc) /* cause ldisc to notice changes */ - ldisc_echoedit_update(term->ldisc); - break; case 25: /* DECTCEM: enable/disable cursor */ compatibility2(OTHER, VT220); term->cursor_on = state; @@ -7025,15 +7019,6 @@ void term_lost_clipboard_ownership(Terminal *term, int clipboard) term_out(term); } -bool term_ldisc(Terminal *term, int option) -{ - if (option == LD_ECHO) - return false; - if (option == LD_EDIT) - return term->term_editing; - return false; -} - static void term_added_data(Terminal *term) { if (!term->in_term_out) { diff --git a/terminal.h b/terminal.h index b8258630..23c91e1f 100644 --- a/terminal.h +++ b/terminal.h @@ -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_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 */ bool utf; /* Are we in toggleable UTF-8 mode? */ diff --git a/unix/uxplink.c b/unix/uxplink.c index cb059893..13f4a898 100644 --- a/unix/uxplink.c +++ b/unix/uxplink.c @@ -79,10 +79,6 @@ char *x_get_default(const char *key) { return NULL; /* this is a stub */ } -bool term_ldisc(Terminal *term, int mode) -{ - return false; -} static void plink_echoedit_update(Seat *seat, bool echo, bool edit) { /* Update stdin read mode to reflect changes in line discipline. */ diff --git a/windows/winplink.c b/windows/winplink.c index 446de78d..46c19c69 100644 --- a/windows/winplink.c +++ b/windows/winplink.c @@ -43,10 +43,6 @@ WSAEVENT netevent; static Backend *backend; Conf *conf; -bool term_ldisc(Terminal *term, int mode) -{ - return false; -} static void plink_echoedit_update(Seat *seat, bool echo, bool edit) { /* Update stdin read mode to reflect changes in line discipline. */