simon-git: putty (main): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Sat Aug 10 14:32:07 BST 2024


TL;DR:
  3c3c1792 Don't set term->wrapnext when not in auto-wrapping mode.
  6439c93b Add a Features checkbox to disable bracketed paste mode.
  81dcace4 Windows: assign the right handle into conio->hout.
  8005738e Fix infinite loop on a truncated RFC4176 public key file.

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-08-10 14:32:07

commit 3c3c17923788d9450f7289abc235d7623252207b
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=3c3c17923788d9450f7289abc235d7623252207b;hp=22f8122b13e6c856aad9c8a76ace72d1f783dc2f
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Aug 10 10:38:02 2024 +0100

    Don't set term->wrapnext when not in auto-wrapping mode.
    
    A user sent a transcript from a curses-based tool 'ncmpc', which
    carefully disables terminal autowrap when printing a character in the
    bottom right corner of the display, and then turns it back on again.
    After that, it expects that sending the backspace character really
    moves the cursor back a space, instead of clearing the wrapnext flag.
    
    But in PuTTY, we set the wrapnext flag even if we're not in wrapping
    mode - it just doesn't _do_ anything when the next character is sent.
    But it remains set, and still affects backspace. So the display is
    corrupted by this change of expectation.
    
    (Specifically, ncmpc is printing a time display [m:ss] in the very
    bottom right, so it disables wrap in order to print the final ']'.
    Then the next thing it needs to do is to update the low-order digit of
    the seconds field, so it sends \b as the simplest way to get to that
    character. The effect on the display is that the updated seconds digit
    appears where the ] was, instead of overwriting the old seconds digit.)
    
    This is a tradeoff in desirable behaviours. The point of having a
    backspace operation cancel the wrapnext flag and not actually move the
    cursor is to preserve the invariant that sending 'x', backspace, 'y'
    causes the y to overprint the x, even if that happens near the end of
    the terminal's line length. In non-wrapping mode that invariant was
    bound to break _eventually_, but with this change, it breaks one
    character earlier than before. However, I think that's less bad than
    breaking the expectations of curses-based full-screen applications,
    especially since the _main_ need for that invariant arises from naïve
    applications that don't want to have to think about the terminal width
    at all - and those applications generally run in _wrapping_ mode,
    where it's possible to continue the invariant across multiple lines in
    any case.

 terminal/terminal.c  | 36 ++++++++++++++++++++++++++----------
 test/test_terminal.c | 32 ++++++++++++++------------------
 2 files changed, 40 insertions(+), 28 deletions(-)

commit 6439c93b436a662b68e6cc83d5a3790b3388d0f8
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=6439c93b436a662b68e6cc83d5a3790b3388d0f8;hp=3c3c17923788d9450f7289abc235d7623252207b
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Aug 10 12:11:28 2024 +0100

    Add a Features checkbox to disable bracketed paste mode.
    
    I've had more than one conversation recently in which users have
    mentioned finding this mode inconvenient. I don't know whether any of
    them would want to turn it off completely, but it seems likely that
    _somebody_ will, sooner or later. So here's an option to do that.

 conf.h              |  5 +++++
 config.c            |  3 +++
 doc/config.but      | 28 ++++++++++++++++++++++++++++
 doc/index.but       |  2 ++
 terminal/terminal.c |  3 ++-
 terminal/terminal.h |  1 +
 windows/help.h      |  1 +
 7 files changed, 42 insertions(+), 1 deletion(-)

commit 81dcace4f10feabbc9722e2531b834a6651152d3
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=81dcace4f10feabbc9722e2531b834a6651152d3;hp=6439c93b436a662b68e6cc83d5a3790b3388d0f8
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Aug 10 13:15:05 2024 +0100

    Windows: assign the right handle into conio->hout.
    
    Thanks to Will Bond for spotting this. Using STD_INPUT_HANDLE as an
    output handle apparently works often enough that I didn't immediately
    notice the mistake, but it's not what I _meant_ to do. Obviously we
    should have used STD_OUTPUT_HANDLE instead.

 windows/console.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit 8005738eaf7c8a0d13509e1606601cf799f00dd2
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=8005738eaf7c8a0d13509e1606601cf799f00dd2;hp=81dcace4f10feabbc9722e2531b834a6651152d3
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Aug 10 13:39:17 2024 +0100

    Fix infinite loop on a truncated RFC4176 public key file.
    
    You could reproduce this, for example, by cutting the final line
    reading "---- END SSH2 PUBLIC KEY ----" off the end of a file, and
    feeding it to Unix 'puttygen -l'.
    
    rfc4716_loadpub() was looping round on get_chomped_line() until it
    found a line starting with "-" after the base64 data. But it failed to
    check for the end of the file as well, so if the data was truncated,
    it would just keep spinning at the end of the file.

 sshpubk.c          |  2 ++
 test/cryptsuite.py | 30 ++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+)



More information about the tartarus-commits mailing list