Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
b6b95f2
Treat SOS and PM terminal escape sequences like APC
stefanct Dec 22, 2024
193e2ec
Rework identification of OSC sequences.
sgtatham Dec 22, 2024
d96a498
gitcommit.cmake: work around Windows pathname aliasing.
sgtatham Dec 27, 2024
e3272f1
It's a new year.
jtn20 Jan 7, 2025
6ec4240
Windows: fix leak of a Filename.
jtn20 Jan 7, 2025
b088d77
GTK: hard-code some last-ditch fallback fonts.
sgtatham Jan 9, 2025
7f4cccd
GTK: fixes to the previous font fallback patch.
sgtatham Jan 10, 2025
6155365
GTK: switch the default to client-side fonts.
sgtatham Jan 10, 2025
ce7a451
Merge GetDlgItemTextW_alloc fix from 'pre-0.83'.
sgtatham Jan 13, 2025
6ffb0e0
Merge ldisc_send fix from 'pre-0.83'.
sgtatham Jan 16, 2025
5b2fa80
Merge Pageant signop_free fix from 'pre-0.83'.
sgtatham Jan 18, 2025
520fd3d
Merge request_file buffer length fix from 'pre-0.83'.
sgtatham Jan 25, 2025
05a13d5
GetDlgItemText_alloc: avoid realloc loop.
sgtatham Jan 25, 2025
da8241c
Remove test for, and fallback impl of, wmemchr.
sgtatham Jan 26, 2025
476ecf4
Merge kex-hybrid memory leak fix from 'pre-0.83'
sgtatham Feb 1, 2025
edd9df9
Merge tag '0.83'
sgtatham Feb 8, 2025
267f077
Reorganise the release checklist.
sgtatham Feb 8, 2025
ee72268
Docs: improve -share/-noshare docs.
jtn20 Feb 11, 2025
5814bdf
Docs: replace long-dead link for Netcat.
jtn20 Feb 11, 2025
54648a1
Docs: consistently use \- for options.
jtn20 Feb 11, 2025
188d7c9
Docs: consistent indexing of command-line options.
jtn20 Feb 11, 2025
b205622
Docs: index some missing command-line options.
jtn20 Feb 11, 2025
1c86360
Docs: clarify wording about host key staleness.
jtn20 Feb 11, 2025
50e360f
Docs: belated updates for protocol controls.
jtn20 Feb 11, 2025
965057d
Change strategy for the Arm instruction setting DIT.
sgtatham Feb 15, 2025
64712be
Non-SSH backends: delay setting trust status to false.
sgtatham Feb 27, 2025
0ea6a31
icons: gitignore update for SVG files.
sgtatham Mar 8, 2025
58b0fbf
icons: HTML preview page.
sgtatham Mar 8, 2025
308a85f
icons: build true-colour installer icons unconditionally.
sgtatham Mar 8, 2025
a3cd2a5
SVG icons: fix computer/monitor alignment.
sgtatham Mar 8, 2025
0a77b18
SVG icons: support black-and-white mode.
sgtatham Mar 8, 2025
feaadd9
SVG icons: adjust the hat on the Pageant icon.
sgtatham Mar 8, 2025
24a2ede
Docs: mention certificates in faq-hostkeys.
jtn20 Mar 17, 2025
2b00d59
Parse DCS commands too
krobelus Mar 12, 2025
c229a5e
Remove residual declaration of term_key() and related constants
bjh21 Mar 26, 2025
e98071d
GTK: tell the input method context about focus changes
bjh21 Mar 27, 2025
5ef7f2e
Correct a comment referring to Contexts, which we no longer have
bjh21 Apr 1, 2025
7f96069
Use _Countof to implement lenof, where available.
sgtatham Apr 3, 2025
f2d6338
Stop cursor attributes being temporary
bjh21 Apr 3, 2025
7a10053
Rename cursor attributes from the TATTR_ to the ATTR_ namespace
bjh21 Apr 3, 2025
6332497
test_unicode_norm: fix display of failing tests.
sgtatham Apr 4, 2025
fbea30b
GTK: trivially handle preedit signals
bjh21 Mar 26, 2025
227b9ae
GTK: also log the preedit string
bjh21 Mar 26, 2025
194ca31
Add an API for passing pre-edit text to terminal; call from GTK
bjh21 Mar 30, 2025
35caff4
Decode UTF-8 in pre-edit text
bjh21 Mar 30, 2025
ab9dfc5
Very crude support for displaying pre-edit strings
bjh21 Mar 30, 2025
b72fec0
Display some IM pre-edit state when painting the terminal
bjh21 Mar 31, 2025
3ab279f
Minimal viable pre-edit support
bjh21 Apr 1, 2025
f9928fb
Initialise pre-edit character cells to basic_erase_char
bjh21 Apr 2, 2025
29ac4da
Support longer pre-edit text
bjh21 Apr 2, 2025
3bbde58
Properly hide existing combining characters with pre-edit text
bjh21 Apr 5, 2025
4776885
Use a little termline to store pre-edit text
bjh21 Apr 5, 2025
d8493c1
Construct preedit_termline incrementally
bjh21 Apr 5, 2025
6532408
Support combining characters in pre-edit strings
bjh21 Apr 5, 2025
4f4f752
Put the cursor at the right-hand end of the pre-edit string
bjh21 Apr 5, 2025
fee5947
Remove recently-added debug() calls from terminal.c
bjh21 Apr 5, 2025
368d74c
Remove two unused variables.
sgtatham Apr 6, 2025
9fcff77
Set ATTR_RIGHTCURS on pre-edit cursor
bjh21 Apr 6, 2025
d1ff568
Add some exceptions in .gitignore.
sgtatham Apr 19, 2025
d9a2620
GTK: correct a couple of comments to reflect GTK 3's existence
bjh21 Apr 20, 2025
5cf14b4
GTK: slightly reword a comment to reflect Cairo documentation
bjh21 Apr 16, 2025
11f4e2d
GTK: use Cairo to read X font bitmaps from server
bjh21 Apr 21, 2025
429478f
GTK: less-fuzzy bitmap font scaling with Cairo
bjh21 Apr 23, 2025
c71cc50
Windows: cope if caret blinking is disabled.
sgtatham Apr 24, 2025
578ed46
GTK: correct a misuse of WhitePixel and BlackPixel
bjh21 Apr 24, 2025
01043ce
GTK: simpler text scaling under Cairo
bjh21 Apr 26, 2025
c93a225
GTK: use cairo_paint() to copy from backing store to screen
bjh21 Apr 10, 2025
daed720
GTK: create backing Cairo surface of similar type to window
bjh21 Apr 19, 2025
1ebca75
GTK: make inst->pixmap and inst->surface mutually exclusive
bjh21 Apr 20, 2025
8260ea2
GTK: disable GTK double-buffering of terminal drawing area
bjh21 Apr 20, 2025
08bc670
GTK: never deliberately create an image surface for Cairo rendering
bjh21 Apr 20, 2025
9bd1b23
GTK: purely server-side X bitmap font rendering with Cairo
bjh21 Apr 25, 2025
c3e2bf9
GTK: clean up old X/Cairo font rendering code
bjh21 Apr 25, 2025
10fdd29
GTK: clear target Pixmap for X font rendering with Cairo
bjh21 Apr 26, 2025
82da46d
GTK: remove most of the scale-factor support
bjh21 Apr 27, 2025
d1a56d6
GTK: use C99 designated initialisers to set up XGCValues
bjh21 Apr 27, 2025
dae2feb
GTK: don't try to turn off double-buffering on GTK 1
bjh21 Apr 30, 2025
c60b283
GTK: flush target Cairo surface in 'draw' handler
bjh21 Apr 30, 2025
647d5a4
GTK: correct a comment calling Cairo surface "client-side"
bjh21 Apr 30, 2025
fcadb5f
GTK: use only 16-bit X text drawing calls
bjh21 May 5, 2025
a0a92da
GTK: don't try to use X fonts for characters outside BMP
bjh21 May 5, 2025
19353dc
GTK: faster rendering of X fonts under Cairo
bjh21 May 5, 2025
649c815
GTK: use a persistent pixmap for rendering X fonts under Cairo
bjh21 May 6, 2025
b66ec0c
GTK/x11font/Cairo: use XDrawString16 instead of XDrawImageString16
bjh21 May 6, 2025
91ad3af
Use MSG_NOSIGNAL when sending on network sockets.
sgtatham May 28, 2025
26a8ef3
Fix crash in utmp-stamping on Wayland.
sgtatham Jun 25, 2025
0c5fd78
GTK: stop using GDK_CURRENT_TIME.
sgtatham Jul 24, 2025
edce58d
HTTP proxy: fix misspelled error message (and comment).
sgtatham Jul 26, 2025
b7db186
More general function to delete toplevel callbacks.
sgtatham Jul 25, 2025
bb8894f
Windows: clear pending netevents when closing a socket.
sgtatham Jul 24, 2025
3cbe852
Windows: fix memory leak in the stale-netevent fix.
sgtatham Jul 31, 2025
2eee884
Windows: fix stale-netevent problem in the CLI tools.
sgtatham Jul 31, 2025
580ab26
HTTP proxy digest auth: tolerate multiple qop options.
sgtatham Aug 1, 2025
2a5f604
Makefile rules for icons used on putty.software.
sgtatham Aug 16, 2025
e952f37
FAQ: update website/hosting/forges section.
sgtatham Aug 16, 2025
9cb330c
udp.but: fix braino in example function names.
sgtatham Sep 27, 2025
c4fe7b0
Add a FAQ about LLM usage, or rather, the lack thereof.
sgtatham Oct 19, 2025
f9cbe22
Fix pointer-handling bug in write_random_seed().
sgtatham Oct 23, 2025
148c3b0
FAQ: add link from faq-hostkeys to '-hostkey' docs.
jtn20 Nov 6, 2025
36a0496
Remove spurious \n in OpenSSH key import diagnostics.
sgtatham Jan 2, 2026
7859903
cryptsuite: remove a stray import statement.
sgtatham Jan 2, 2026
3fd66c6
OpenSSH key import: support aes256-gcm encrypted keys.
sgtatham Jan 2, 2026
995b63a
It's a new year.
sgtatham Jan 2, 2026
d222b73
Refactor icons/Makefile.
sgtatham Jan 4, 2026
8cdd0bb
Add 64-pixel images to the Windows .ico files.
sgtatham Jan 4, 2026
c494fe8
Clarify the LLMs FAQ entry.
sgtatham Jan 10, 2026
fd08a77
Weed the FAQ.
sgtatham Jan 10, 2026
c15d4d7
Fix edge case in ecc_weierstrass_add_general doubling.
sgtatham Jan 14, 2026
4448d1a
Unix: create ~/.putty/sshhostcas if necessary.
sgtatham Jan 23, 2026
5b6e89c
Don't accidentally interpret DCS escapes as OSC.
sgtatham Jan 30, 2026
f4a99c5
Move Telnet proxy command formatting into utils.
sgtatham Feb 8, 2026
503d613
New feature: a pre-connection command hook.
sgtatham Jan 10, 2026
37c7e69
Disallow -preconnectcommand in pterm.
jtn20 Feb 18, 2026
1c0490d
Add an accelerator for pre-connect command.
jtn20 Feb 18, 2026
458652d
Add -preconnectcommand to usage messages.
jtn20 Feb 18, 2026
af33ecd
Docs: improve pre-connect command documentation.
jtn20 Feb 18, 2026
af996b5
eddsa_verify: add check for out-of-range s.
sgtatham Feb 25, 2026
ccd3d37
Centralise the call to execute_command_hook.
sgtatham Apr 13, 2026
1bf88ff
New centralised system for waiting for subprocesses.
sgtatham Apr 14, 2026
6aab75a
HandleSocket: stop tying input and output EOF together.
sgtatham Apr 14, 2026
a0659c2
Run pre-connect commands via platform_start_subprocess.
sgtatham Apr 13, 2026
ff89d58
Refactor pty_real_select_result. (NFC)
sgtatham Apr 14, 2026
7a7da33
Switch unix/pty.c to use the new SubprocessWaiter.
sgtatham Apr 14, 2026
85703a8
Add a horizontal scrollbar in the Windows Event Log.
sgtatham Apr 15, 2026
ea1038a
GTK: switch embedded icons to raw RGBA rather than xpm.
sgtatham Apr 15, 2026
3c59840
Fix handling of ECONNREFUSED in GTK 1 builds (!)
sgtatham Apr 15, 2026
cd18fb7
Tidy up the elliptic curve multiplication tests.
sgtatham Mar 30, 2026
7db1f65
ecdsa_public: reduce exponent mod the right thing!
sgtatham Apr 1, 2026
65b8f37
Remove bogus assertion in ecc_weierstrass_add.
sgtatham Mar 28, 2026
adc9c13
Docs: add wake-on-LAN as a use case for pre-connect commands.
sgtatham May 3, 2026
29d8bd9
Docs: index 'wake-on-LAN', on general principles.
jtn20 May 3, 2026
e524218
Windows on Arm: use hardware SHA-512 accel if available.
sgtatham May 10, 2026
ba3ed53
Don't call sfree after ssh_rsakex_freekey.
sgtatham May 14, 2026
cda57ec
Update version number for 0.84 release.
sgtatham May 14, 2026
b97d7f2
Merge 0.83-cn1 中文化到 0.84
larryli May 25, 2026
d6dbb4f
更新版本号至 0.84,修正版权年份,翻译连接设置相关文本
larryli May 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,15 @@ cmake_install.cmake
/build.out
/empty.h
Makefile
!/contrib/cygtermd/Makefile
!/icons/Makefile
/compile
*.a
/charset/sbcsdat.c
/contrib/cygtermd/cygtermd.exe
/doc/*.html
/doc/*.txt
!/doc/CMakeLists.txt
/doc/*.cnt
/doc/*.hlp
/doc/*.gid
Expand All @@ -99,6 +102,7 @@ Makefile
/icons/*.ico
/icons/*.icns
/icons/*.xpm
/icons/*.svg
/icons/*.c
/unix/empty.h
/unix/plink
Expand Down
2 changes: 1 addition & 1 deletion Buildscr
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module putty
ifeq "$(RELEASE)" "" set Ndate $(!builddate)
ifneq "$(Ndate)" "" in . do echo $(Ndate) | perl -pe 's/(....)(..)(..)/$$1-$$2-$$3/' > date
ifneq "$(Ndate)" "" read Date date
set Epoch 19120 # update this at every release
set Epoch 19587 # update this at every release
ifneq "$(Ndate)" "" in . do echo $(Ndate) | perl -ne 'use Time::Local; /(....)(..)(..)/ and print timegm(0,0,0,$$3,$$2-1,$$1) / 86400 - $(Epoch)' > days
ifneq "$(Ndate)" "" read Days days

Expand Down
80 changes: 42 additions & 38 deletions CHECKLST.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ Making a release candidate build
- Make the release tag, pointing at the version-update commit we just
generated.

- If the release tag is on a branch (which I expect it generally will
be), prepare a merge to main, and make sure it builds sensibly.
Even if the branch consists of nothing but cherry-picks _from_
main, this will mean that the 'update version number' change
appears on main and the snapshots start announcing themselves as
post-X.YZ. But also, if there's anything new on the branch, this is
how it gets on to main as well.

- Make a release-candidate build from the release tag, and put the
build.out and build.log files somewhere safe. Normally I store
these inside the ~/src/putty/X.YZ directory, alongside the git
Expand Down Expand Up @@ -146,24 +154,10 @@ Making a release candidate build
* do some testing on a system with a completely clean slate (no
prior saved session data)

Preparing to make the release
-----------------------------

- Write a release announcement (basically a summary of the changes
since the last release). Check the draft version into the putty-aux
repository, so the whole team can help wordsmith it if they want to.

- Update the website, in a local checkout:
* Write a release file in components/releases which identifies the
new version, a section for the Changes page, and a news
announcement for the front page.
+ The one thing this can't yet contain is the release date;
that has to be put in at the last minute, when the release
goes live. Fill in 'FIXME', for the moment.
* Disable the pre-release sections of the website (if previously
enabled), by editing prerel_version() in components/Base.mc to
return undef.

- Prepare some 'what's new in this release' blurb for the Windows
Store. This should be very brief - even briefer than the website
news item.
Expand All @@ -184,14 +178,43 @@ Preparing to make the release
fixing a #vulnerability. That's how people will find the toot.
* Again, commit to putty-aux for team review.

- Update the wishlist, in a local checkout:
- Prepare a website update:
* Write a release file in components/releases which identifies the
new version, a section for the Changes page, and a news
announcement for the front page.
+ The one thing this can't yet contain is the release date;
that has to be put in at the last minute, when the release
goes live. Fill in 'FIXME', for the moment.
* Disable the pre-release sections of the website (if previously
enabled), by editing prerel_version() in components/Base.mc to
return undef.
* Push to the private clone of the website repo for the team to
check over.

- Prepare a wishlist update:
* If there are any last-minute wishlist entries (e.g. security
vulnerabilities fixed in the new release), write entries for
them.
* If any other bug fixes have been cherry-picked to the release
branch (so that the wishlist mechanism can't automatically mark
them as fixed in the new release), add appropriate Fixed-in
headers for those.
* Push to the private clone of the wishlist repo for the team to
check over.

The actual release procedure
----------------------------

Once all the above preparation is done and we've decided we have a
good release candidate and a good set of announcements, wishlist
entries etc, this is the procedure for putting it all up on the web.

- Log in to the MS Partner Center and make sure everything is in
order. If the UI has completely changed, make sure you can find
your way around the new one; if it wants you to read an enormous
document of revised T&Cs, get that out of the way in advance, so it
doesn't suddenly become a delay in the middle of the actual
release.

- Sign the release in full. In the `build-X.YZ-rcN.out' directory,
re-verify that the preliminary signed checksums file has a correct
Expand All @@ -209,29 +232,10 @@ Preparing to make the release
sh sign.sh -r putty # and enter the release key passphrase
chmod -R a-w putty

- If the release is on a branch (which I expect it generally will
be), prepare a merge of that branch to main. Even if the branch
consists of nothing but cherry-picks _from_ main, this will mean
that the 'update version number' change appears on main and the
snapshots start announcing themselves as post-X.YZ. But also, if
there's anything new on the branch, this is how it gets on to main
as well.

- Log in to the MS Partner Center and make sure everything is in
order. If the UI has completely changed, make sure you can find
your way around the new one; if it wants you to read an enormous
document of revised T&Cs, get that out of the way in advance, so it
doesn't suddenly become a delay in the middle of the actual
release.

The actual release procedure
----------------------------

Once all the above preparation is done and the release has been built
locally, this is the procedure for putting it up on the web.

- Make a final adjustment to your local website changes, filling in
the release date in components/releases/X.YZ.mi.
- Make final adjustments to the local website and wishlist changes,
filling in the release date in components/releases/X.YZ.mi, and any
missing (e.g. not previously finalised) commit hashes in wishlist
entries. Check that both look sensible locally.

- Upload the release itself and its link maps to everywhere it needs
to be, by running this in the build-X.YZ-rcN.out directory:
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ add_library(network STATIC
proxy/socks4.c
proxy/socks5.c
proxy/telnet.c
proxy/newmain.c
proxy/local.c
proxy/interactor.c)

Expand Down
2 changes: 1 addition & 1 deletion LATEST.VER
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.83
0.84
4 changes: 2 additions & 2 deletions LICENCE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PuTTY is copyright 1997-2025 Simon Tatham.
PuTTY is copyright 1997-2026 Simon Tatham.

部分版权属于 Robert de Bath, Joris van Rantwijk, Delian
Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas Barry,
Expand All @@ -14,4 +14,4 @@ Kuzmich, Nico Williams, Viktor Dukhovni, Josh Dersch, Lars Brinkhoff,

该软件是作为 "AS IS" 提供,没有任何保证、表示或暗示,包括但不限于适销性、适用性和不侵权。在任何情况下作者不对任何声明、损坏或其他责任负责,无论是发生在合同行为、侵权或其它任何来自软件的、与软件相关或无关的以及软件的使用。

PuTTY 中文版的版权属于 2003-2025 李峰,保留所有权利。
PuTTY 中文版的版权属于 2003-2026 李峰,保留所有权利。
21 changes: 17 additions & 4 deletions callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ void queue_idempotent_callback(struct IdempotentCallback *ic)
queue_toplevel_callback(run_idempotent_callback, ic);
}

void delete_callbacks_for_context(void *ctx)
void delete_callbacks(
bool (*delete_this_one)(void *predicate_ctx, toplevel_callback_fn_t fn,
void *callback_ctx), void *predicate_ctx)
{
struct callback *newhead, *newtail;

newhead = newtail = NULL;
while (cbhead) {
struct callback *cb = cbhead;
cbhead = cbhead->next;
if (cb->ctx == ctx ||
(cb->fn == run_idempotent_callback &&
((struct IdempotentCallback *)cb->ctx)->ctx == ctx)) {
if (delete_this_one(predicate_ctx, cb->fn, cb->ctx)) {
sfree(cb);
} else {
if (!newhead)
Expand All @@ -69,6 +69,19 @@ void delete_callbacks_for_context(void *ctx)
newtail->next = NULL;
}

static bool callback_is_for_context(
void *predicate_ctx, toplevel_callback_fn_t fn, void *callback_ctx)
{
return callback_ctx == predicate_ctx ||
(fn == run_idempotent_callback &&
((struct IdempotentCallback *)callback_ctx)->ctx == predicate_ctx);
}

void delete_callbacks_for_context(void *ctx)
{
delete_callbacks(callback_is_for_context, ctx);
}

void queue_toplevel_callback(toplevel_callback_fn_t fn, void *ctx)
{
struct callback *cb;
Expand Down
8 changes: 7 additions & 1 deletion charset/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
#define charset_internal_h

/* This invariably comes in handy */
#define lenof(x) ( sizeof((x)) / sizeof(*(x)) )
#ifndef lenof
#if HAVE_COUNTOF
#define lenof(x) _Countof(x)
#else
#define lenof(x) ( (sizeof((x))) / (sizeof(*(x))))
#endif
#endif

/* This is an invalid Unicode value used to indicate an error. */
#define ERROR 0xFFFFL /* Unicode value representing error */
Expand Down
3 changes: 2 additions & 1 deletion cmake/cmake.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

#cmakedefine NO_MULTIMON

#cmakedefine01 HAVE_COUNTOF

#cmakedefine01 HAVE_WINRESRC_H
#cmakedefine01 HAVE_WINRES_H
#cmakedefine01 HAVE_WIN_H
Expand All @@ -15,7 +17,6 @@
#cmakedefine01 HAVE_GETNAMEDPIPECLIENTPROCESSID
#cmakedefine01 HAVE_SETDEFAULTDLLDIRECTORIES
#cmakedefine01 HAVE_STRTOUMAX
#cmakedefine01 HAVE_WMEMCHR
#cmakedefine01 HAVE_DWMAPI_H

#cmakedefine NOT_X_WINDOWS
Expand Down
36 changes: 17 additions & 19 deletions cmake/gitcommit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,32 @@ set(commit "${DEFAULT_COMMIT}")
set(TOPLEVEL_SOURCE_DIR ${CMAKE_SOURCE_DIR})

execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --show-toplevel
OUTPUT_VARIABLE git_worktree
COMMAND ${GIT_EXECUTABLE} rev-parse --show-cdup
OUTPUT_VARIABLE path_to_top
ERROR_VARIABLE stderr
RESULT_VARIABLE status)
string(REGEX REPLACE "\n$" "" git_worktree "${git_worktree}")
string(REGEX REPLACE "\n$" "" path_to_top "${path_to_top}")

if(status EQUAL 0)
if(git_worktree STREQUAL CMAKE_SOURCE_DIR)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
OUTPUT_VARIABLE git_commit
ERROR_VARIABLE stderr
RESULT_VARIABLE status)
if(status EQUAL 0)
string(REGEX REPLACE "\n$" "" commit "${git_commit}")
else()
if(commit STREQUAL "unavailable")
message("Unable to determine git commit: 'git rev-parse HEAD' returned status ${status} and error output:\n${stderr}\n")
endif()
endif()
# If we're at the top of a git repository, --show-cdup will print the
# empty string (followed by a newline) and return success. If we're
# lower down, it will return a sequence of "../../" that leads to the
# top; if we're higher up it will fail with an error.
if(status EQUAL 0 AND path_to_top STREQUAL "")
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
OUTPUT_VARIABLE git_commit
ERROR_VARIABLE stderr
RESULT_VARIABLE status)
if(status EQUAL 0)
string(REGEX REPLACE "\n$" "" commit "${git_commit}")
else()
if(commit STREQUAL "unavailable")
message("Unable to determine git commit: top-level source dir ${CMAKE_SOURCE_DIR} is not the root of a repository")
message("Unable to determine git commit: 'git rev-parse HEAD' returned status ${status} and error output:\n${stderr}\n")
endif()
endif()
else()
if(commit STREQUAL "unavailable")
message("Unable to determine git commit: 'git rev-parse --show-toplevel' returned status ${status} and error output:\n${stderr}\n")
message("Unable to determine git commit: top-level source dir ${CMAKE_SOURCE_DIR} is not the root of a repository")
endif()
endif()

Expand Down
2 changes: 1 addition & 1 deletion cmake/platforms/unix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ if(GTK_FOUND)
list(APPEND CMAKE_REQUIRED_INCLUDES ${GTK_INCLUDE_DIRS})
check_include_file(gdk/gdkx.h HAVE_GDK_GDKX_H)

if(X11_FOUND AND HAVE_GDK_GDKX_H)
if(X11_FOUND AND X11_Xrender_FOUND AND HAVE_GDK_GDKX_H)
set(NOT_X_WINDOWS OFF PARENT_SCOPE)
else()
set(NOT_X_WINDOWS ON PARENT_SCOPE)
Expand Down
1 change: 0 additions & 1 deletion cmake/platforms/windows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ define_negation(NO_HTMLHELP HAVE_HTMLHELP_H)
check_include_files("winsock2.h;afunix.h" HAVE_AFUNIX_H)

check_symbol_exists(strtoumax "inttypes.h" HAVE_STRTOUMAX)
check_symbol_exists(wmemchr "wchar.h" HAVE_WMEMCHR)
check_symbol_exists(AddDllDirectory "windows.h" HAVE_ADDDLLDIRECTORY)
check_symbol_exists(SetDefaultDllDirectories "windows.h"
HAVE_SETDEFAULTDLLDIRECTORIES)
Expand Down
6 changes: 6 additions & 0 deletions cmake/setup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ int main(int argc, char **argv) {
free(p);
}" HAVE_ALIGNED_ALLOC)

check_c_source_compiles("
int main(int argc, char **argv) {
int a[3];
return _Countof(a);
}" HAVE_COUNTOF)

if(PUTTY_DEBUG)
add_compile_definitions(DEBUG)
endif()
Expand Down
6 changes: 6 additions & 0 deletions cmdline.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,12 @@ int cmdline_process_param(CmdlineArg *arg, CmdlineArg *nextarg,
SAVEABLE(0);
conf_set_str(conf, CONF_loghost, value);
}
if (!strcmp(p, "-preconnectcommand")) {
RETURN(2);
UNAVAILABLE_IN(TOOLTYPE_NONNETWORK);
SAVEABLE(1);
conf_set_str(conf, CONF_pre_connect_command, value);
}
if (!strcmp(p, "-hostkey")) {
char *dup;
RETURN(2);
Expand Down
5 changes: 5 additions & 0 deletions conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ CONF_OPTION(loghost, /* logical host being contacted, for host key check */
DEFAULT_STR(""),
SAVE_KEYWORD("LogHost"),
)
CONF_OPTION(pre_connect_command,
VALUE_TYPE(STR),
DEFAULT_STR(""),
SAVE_KEYWORD("PreConnectCommand"),
)

/* Proxy options */
CONF_OPTION(proxy_exclude_list,
Expand Down
6 changes: 6 additions & 0 deletions config.c
Original file line number Diff line number Diff line change
Expand Up @@ -2512,6 +2512,12 @@ void setup_config_box(struct controlbox *b, bool midsession,
HELPCTX(connection_loghost),
conf_editbox_handler, I(CONF_loghost), ED_STR);
}

s = ctrl_getset(b, "连接", "hooks",
"连接事件发生时运行的命令");
ctrl_editbox(s, "连接前运行命令(B)", 'b', 100,
HELPCTX(connection_pre_hook),
conf_editbox_handler, I(CONF_pre_connect_command), ED_STR);
}

/*
Expand Down
11 changes: 9 additions & 2 deletions crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,16 @@ if(neon)
endif()

test_compile_with_flags(HAVE_ARM_DIT
GNU_FLAGS -march=armv8.4-a
TEST_SOURCE "
int main(void) { asm volatile(\"msr dit, %0\" :: \"r\"(1)); }"
#ifndef __aarch64__
#error make sure this only even tries to work on AArch64
#endif
#include <stdint.h>
int main(void) {
register uint64_t one asm(\"x8\");
one = 1;
asm volatile(\".inst 0xd51b42a8\" :: \"r\"(one));
}"
ADD_SOURCES_IF_SUCCESSFUL enable_dit.c)

set(HAVE_AES_NI ${HAVE_AES_NI} PARENT_SCOPE)
Expand Down
Loading
Loading