simon-git: putty (main): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Sun Dec 15 19:23:50 GMT 2024
TL;DR:
363debc7 lineedit: make both ^M and ^J terminate a line.
Repository: https://git.tartarus.org/simon/putty.git
On the web: https://git.tartarus.org/?p=simon/putty.git
Branch updated: main
Committer: Simon Tatham <anakin at pobox.com>
Date: 2024-12-15 19:23:50
commit 363debc7f09791a905b94dd6cae96328210ca742
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=363debc7f09791a905b94dd6cae96328210ca742;hp=1fc5f4afd1b554b498f470749237d4fea7a9a405
Author: Simon Tatham <anakin at pobox.com>
Date: Sun Dec 15 19:09:34 2024 +0000
lineedit: make both ^M and ^J terminate a line.
In protocols other than PROT_RAW, the new line editing system differed
from the old one in not considering ^M or ^J (typed using the actual
Ctrl key, so distinct from pressing Return) to mean "I've finished
editing this line, please send it". This commit reinstates that
behaviour.
It turned out that a third-party tool (namely PuTTY Connection Manager),
which automatically answers prompts for the user, was terminating them
by sending ^J in place of the Return key. We don't know why (and it's
now unmaintained), but it was. So this change should make that tool
start working again.
I exclude PROT_RAW above because in that protocol the line editing has
much weirder handling for ^M and ^J, which lineedit replicated
faithfully from the old code: either control character by itself is
treated literally (displaying as "^M" or "^J" in the terminal), but if
you type the two in sequence in that order, then the ^J deletes the ^M
from the edit buffer and enters the line, so that the sequence CR LF
acts as a newline overall. I haven't changed that behaviour here, but
I have added a regression test of it to test_lineedit.
terminal/lineedit.c | 18 ++++++++++++++++
test/test_lineedit.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 77 insertions(+)
More information about the tartarus-commits
mailing list