1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 09:27:59 +00:00

ldisc: fix unwanted double-action of ^U.

In ldisc's line editing mode, pressing ^U is supposed to erase the
current unsent line rather than inserting a literal ^U into the
buffer. In fact, when using a non-Telnet backend, it erases the
line *and* inserts ^U into the buffer!

This happens because it shares a case handler with three other
disruptive control characters (^C, ^\, ^Z), which all also clear the
line-editing buffer before doing their various actions. But in
non-Telnet mode, their actions become literal insertion of themselves,
so the combined effect is to erase the line and them self-insert.

I'm not 100% convinced that was what I actually meant to do with those
characters. But it _certainly_ wasn't what I meant to do with ^U, so
that one at least I should fix right now!
This commit is contained in:
Simon Tatham 2022-12-21 15:05:04 +00:00
parent 95b926865a
commit 5ade8c0047

View File

@ -442,6 +442,8 @@ void ldisc_send(Ldisc *ldisc, const void *vbuf, int len, bool interactive)
bsb(ldisc, plen(ldisc, ldisc->buf[ldisc->buflen - 1]));
ldisc->buflen--;
}
if (c == CTRL('U'))
break; /* ^U *just* erases a line */
ldisc_to_backend_special(ldisc, SS_EL, 0);
/*
* We don't send IP, SUSP or ABORT if the user has