From fe7fcae2abb85e27a602b7fc83cead42644e70f7 Mon Sep 17 00:00:00 2001 From: amitpadhan525 Date: Mon, 5 Oct 2026 23:52:29 +0530 Subject: [PATCH] Ncat: Add --ignore-sigint option to ignore Ctrl+C. Fixes #2752 When Ncat is used as an SSH ProxyCommand, pressing Ctrl+C in an interactive SSH session sends SIGINT to the foreground process group. While SSH handles the signal to send an interrupt packet to the remote session, Ncat terminates under the default signal handler, closing the proxy connection. Add the --ignore-sigint option so Ncat ignores SIGINT (and Windows Console Ctrl-C/Ctrl-Break events), allowing interactive sessions through Ncat proxies to handle Ctrl+C without breaking the tunnel. --- ncat/docs/ncat.1 | 6 ++++++ ncat/ncat_core.c | 1 + ncat/ncat_core.h | 5 +++++ ncat/ncat_listen.c | 3 ++- ncat/ncat_main.c | 3 +++ ncat/ncat_posix.c | 7 +++++++ ncat/ncat_win.c | 17 +++++++++++++++++ 7 files changed, 41 insertions(+), 1 deletion(-) diff --git a/ncat/docs/ncat.1 b/ncat/docs/ncat.1 index 6bf6e309b..30b040dae 100644 --- a/ncat/docs/ncat.1 +++ b/ncat/docs/ncat.1 @@ -79,6 +79,7 @@ Options taking a time assume seconds\&. Append \*(Aqms\*(Aq for milliseconds, \-\-send\-only Only send data, ignoring received; quit on EOF \-\-recv\-only Only receive data, never send anything \-\-no\-shutdown Continue half\-duplex when receiving EOF on stdin + \-\-ignore\-sigint Do not terminate upon receiving SIGINT/Ctrl+C \-q