simon-git: putty (main): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Fri Feb 12 18:27:07 GMT 2021
TL;DR:
e7771a21 Fix missing recalculation of window border.
438c980c Move CSET_OEMCP and CSET_ACP into Unicode surrogate space.
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: 2021-02-12 18:27:07
commit e7771a21d94f56ab9a17c01bc37fab66845a9575
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=e7771a21d94f56ab9a17c01bc37fab66845a9575;hp=6bf3b4947113cc8f9e88d17a483d1bde3b9bb93c
Author: Simon Tatham <anakin at pobox.com>
Date: Fri Feb 12 17:50:47 2021 +0000
Fix missing recalculation of window border.
If you open a Windows PuTTY session and press Win+Right, Windows
auto-sizes the terminal window to cover the right-hand half of the
screen. Then if you press Win+Up it will be auto-sized again, this
time to the top right quadrant. In the second resize (if you don't
have font-based resize handling turned on), the WM_SIZE handler code
will find a path through the twisty maze of ifs on which the border
between the text and the client-area edges is not recomputed, or
invalidated, or redrawn. So you can end up with half a line of text
from the previous window size still visible at the bottom of the new
window.
Fixed by factoring out the offset-recomputation code from the large
and complicated reset_window(), so that I can call just that snippet
on the dangerous code path.
windows/window.c | 43 +++++++++++++++++++++++++++++++++++++------
1 file changed, 37 insertions(+), 6 deletions(-)
commit 438c980cf11d990c68339743fe03c66116672339
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=438c980cf11d990c68339743fe03c66116672339;hp=e7771a21d94f56ab9a17c01bc37fab66845a9575
Author: Simon Tatham <anakin at pobox.com>
Date: Fri Feb 12 17:35:48 2021 +0000
Move CSET_OEMCP and CSET_ACP into Unicode surrogate space.
Each of these #defines represents a block of 256 code values that are
used, internally to the terminal code, to indicate that a character is
in one of the currently selected single-byte character sets. One
effect of this is that reconfiguring the character set in mid-session
causes all the text already on screen to be redrawn.
Unfortunately, those 512 code points were allocated at 0xF000-0xF1FF,
which is inside the Unicode private-use area. So if a font uses that
area to define actually useful glyphs, then those glyphs won't be
displayed correctly by PuTTY; instead, outputting 0xF000+'A' (for
example) will display as 'A'. A user recently reported this problem
with the 'Hack' font from https://github.com/ryanoasis/nerd-fonts .
RDB's comment next to the #defines suggested that this was done on
purpose for consistency with Linux (though it's not clear what part of
Linux; perhaps the virtual console driver used to work this way?). But
now it's getting in the way of actually useful Unicode characters,
that consistency doesn't seem like the most important thing. (Also, it
just seems wrong to me that you even _can_ cause PuTTY's terminal
emulator to use these special internal character representations by
sending legal UTF-8.)
So I've moved this block of 512 characters to 0xDC00, which is in the
Unicode surrogate space, and hence can't be stored in the terminal by
sending UTF-8 at all (since our UTF-8 decoder rejects that range, as
per spec). That's where we were already keeping other magic blocks
like CSET_LINEDRW and CSET_SCOACS, and there's still room for two
more.
The net effect should be that in Windows PuTTY, U+F000 to U+F1FF are
now displayed as whatever your font wants to show.
putty.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
More information about the tartarus-commits
mailing list