From 2a744340c1704a454ec05b61e62742dcf989533c Mon Sep 17 00:00:00 2001 From: osown Date: Wed, 3 Feb 2021 21:57:18 +0100 Subject: [PATCH] Fix SIGINT hanndling inside debugee --- src/debugpy/launcher/__main__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/debugpy/launcher/__main__.py b/src/debugpy/launcher/__main__.py index a3b4eb910..65c60421e 100644 --- a/src/debugpy/launcher/__main__.py +++ b/src/debugpy/launcher/__main__.py @@ -26,10 +26,12 @@ def main(): log.to_file(prefix="debugpy.launcher") log.describe_environment("debugpy.launcher startup environment:") - # Disable exceptions on Ctrl+C - we want to allow the debuggee process to handle - # these, or not, as it sees fit. If the debuggee exits on Ctrl+C, the launcher - # will also exit, so it doesn't need to observe the signal directly. - signal.signal(signal.SIGINT, signal.SIG_IGN) + if sys.platform == "win32": + # For windows, disable exceptions on Ctrl+C - we want to allow the debuggee + # process to handle these, or not, as it sees fit. If the debuggee exits + # on Ctrl+C, the launcher will also exit, so it doesn't need to observe + # the signal directly. + signal.signal(signal.SIGINT, signal.SIG_IGN) # Everything before "--" is command line arguments for the launcher itself, # and everything after "--" is command line arguments for the debuggee.