simon-git: putty (main): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Sat May 8 17:54:59 BST 2021
TL;DR:
3de2f13b Factor out Windows utility function get_system_dir().
7167c8c7 Move some parts of window.c into putty.c.
27a09093 Move icon declarations out of putty-common.rc2.
cb33708f Make Windows versions of the pterm icons.
a55aac71 New application: a Windows version of 'pterm'!
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-05-08 17:54:59
commit 3de2f13b89ce1f6671488c4b6c0b23f4b825531b
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=3de2f13b89ce1f6671488c4b6c0b23f4b825531b;hp=d77ecacc27adf4c92348a2a3beda5d9e57866af9
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Apr 24 17:15:47 2021 +0100
Factor out Windows utility function get_system_dir().
The code to find out the location of the c:\windows\system32 directory
was already present, in load_system32_dll(). Now it's moved out into a
function of its own, so it can be called in other contexts.
windows/CMakeLists.txt | 1 +
windows/platform.h | 1 +
windows/utils/get_system_dir.c | 21 +++++++++++++++++++++
windows/utils/load_system32_dll.c | 10 +---------
4 files changed, 24 insertions(+), 9 deletions(-)
commit 7167c8c77165211dd352549735a903318c78fde9
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=7167c8c77165211dd352549735a903318c78fde9;hp=3de2f13b89ce1f6671488c4b6c0b23f4b825531b
Author: Simon Tatham <anakin at pobox.com>
Date: Sat May 8 17:20:50 2021 +0100
Move some parts of window.c into putty.c.
This prepares the ground for a second essentially similarly-shaped
program reusing most of window.c but handling its command line and
startup differently. A couple of large parts of WinMain() to do with
backend selection and command-line handling are now subfunctions in a
separate file putty.c.
Also, our custom AppUserModelId is defined in that file, so that it
can vary with the client application.
windows/CMakeLists.txt | 2 +
windows/jump-list.c | 3 +-
windows/platform.h | 9 ++
windows/putty.c | 127 +++++++++++++++++++++++++
windows/window.c | 246 +++++++++++++++++--------------------------------
5 files changed, 224 insertions(+), 163 deletions(-)
commit 27a09093e4140872bac55ff6912978ac1d5dd334
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=27a09093e4140872bac55ff6912978ac1d5dd334;hp=7167c8c77165211dd352549735a903318c78fde9
Author: Simon Tatham <anakin at pobox.com>
Date: Sat May 8 17:23:11 2021 +0100
Move icon declarations out of putty-common.rc2.
Now they're done by putty.rc and puttytel.rc, before including
putty-common.rc2. So another user of putty-common.rc2 can disagree on
what icons to use.
windows/putty-common.rc2 | 6 ------
windows/putty.rc | 4 ++++
windows/puttytel.rc | 4 ++++
3 files changed, 8 insertions(+), 6 deletions(-)
commit cb33708f959b2e6323f02227b58945aa5297ba72
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=cb33708f959b2e6323f02227b58945aa5297ba72;hp=27a09093e4140872bac55ff6912978ac1d5dd334
Author: Simon Tatham <anakin at pobox.com>
Date: Sat May 8 17:22:19 2021 +0100
Make Windows versions of the pterm icons.
icons/Makefile will now rebuild them, but also, as per this code
base's usual policy with Windows icons, they're committed directly in
the windows subdir.
icons/Makefile | 10 +++++++++-
windows/pterm.ico | Bin 0 -> 4078 bytes
windows/ptermcfg.ico | Bin 0 -> 4078 bytes
3 files changed, 9 insertions(+), 1 deletion(-)
commit a55aac71e4fa6cf30f976da6727877c4cb117c96
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=a55aac71e4fa6cf30f976da6727877c4cb117c96;hp=cb33708f959b2e6323f02227b58945aa5297ba72
Author: Simon Tatham <anakin at pobox.com>
Date: Sat May 8 17:24:13 2021 +0100
New application: a Windows version of 'pterm'!
This fulfills our long-standing Mayhem-difficulty wishlist item
'win-command-prompt': this is a Windows pterm in the sense that when
you run it you get a local cmd.exe running inside a PuTTY-style window.
Advantages of this: you get the same free choice of fonts as PuTTY has
(no restriction to a strange subset of the system's available fonts);
you get the same copy-paste gestures as PuTTY (no mental gear-shifting
when you have command prompts and SSH sessions open on the same
desktop); you get scrollback with the PuTTY semantics (scrolling to
the bottom gets you to where the action is, as opposed to the way you
could accidentally find yourself 500 lines past the end of the action
in a real console).
'win-command-prompt' was at Mayhem difficulty ('Probably impossible')
basically on the grounds that with Windows's old APIs for accessing
the contents of consoles, there was no way I could find to get this to
work sensibly. What was needed to make it feasible was a major piece
of re-engineering work inside Windows itself.
But, of course, that's exactly what happened! In 2019, the new ConPTY
API arrived, which lets you create an object that behaves like a
Windows console at one end, and round the back, emits a stream of
VT-style escape sequences as the screen contents evolve, and accepts a
VT-style input stream in return which it will parse function and arrow
keys out of in the usual way.
So now it's actually _easy_ to get this to basically work. The new
backend, in conpty.c, has to do a handful of magic Windows API calls
to set up the pseudo-console and its feeder pipes and start a
subprocess running in it, a further magic call every time the PuTTY
window is resized, and detect the end of the session by watching for
the subprocess terminating. But apart from that, all it has to do is
pass data back and forth unmodified between those pipes and the
backend's associated Seat!
That said, this is new and experimental, and there will undoubtedly be
issues. One that I already know about is that you can't copy and paste
a word that has wrapped between lines without getting an annoying
newline in the middle of it. As far as I can see this is a fundamental
limitation: the ConPTY system sends the _same_ escape sequence stream
for a line that wrapped as it would send for a line that had a logical
\n at what would have been the wrap point. Probably the best we can do
to mitigate this is to adopt a different heuristic for newline elision
that's right more often than it's wrong.
For the moment, that experimental-ness is indicated by the fact that
Buildscr will build, sign and deliver a copy of pterm.exe for each
flavour of Windows, but won't include it in the .zip file or in the
installer. (In fact, that puts it in exactly the same ad-hoc category
as PuTTYtel, although for completely different reasons.)
Buildscr | 10 +-
cmake/platforms/windows.cmake | 1 +
windows/CMakeLists.txt | 22 +++
windows/be_conpty.c | 13 ++
windows/conpty.c | 389 ++++++++++++++++++++++++++++++++++++++++++
windows/platform.h | 4 +-
windows/pterm.c | 45 +++++
windows/pterm.rc | 15 ++
8 files changed, 493 insertions(+), 6 deletions(-)
More information about the tartarus-commits
mailing list