From f8629dc58741dbe66577453e96ad646d461b0a53 Mon Sep 17 00:00:00 2001 From: Rich Chiodo false Date: Wed, 29 Jul 2026 10:00:41 -0700 Subject: [PATCH 1/2] Add breakOnSystemExit setting to launch/attach schema Exposes debugpy's breakOnSystemExit option (microsoft/debugpy#2017) in the extension's launch.json/attach configuration schema and TypeScript debug config types. Accepts an array of exit codes and/or inclusive {from,to} ranges to control which SystemExit codes cause the debugger to break. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 24c2d34b-15f0-45d2-bd59-8ee042269d20 --- package.json | 62 ++++++++++++++++++++++++++++++++++++++++++ src/extension/types.ts | 8 ++++++ 2 files changed, 70 insertions(+) diff --git a/package.json b/package.json index d4e1e1c9..abf77e5c 100644 --- a/package.json +++ b/package.json @@ -186,6 +186,37 @@ }, "type": "object" }, + "breakOnSystemExit": { + "description": "Controls which SystemExit exit codes cause the debugger to break. Accepts an array of exit codes and/or inclusive ranges. Set to an empty array to never break on SystemExit. When omitted, the debugger uses its default behavior (break on all non-zero exit codes, ignoring successful exits).", + "type": "array", + "items": { + "oneOf": [ + { + "type": "integer", + "description": "A specific SystemExit code to break on." + }, + { + "type": "object", + "additionalProperties": false, + "description": "An inclusive range of SystemExit codes to break on.", + "properties": { + "from": { + "type": "integer", + "description": "Lower bound of the range (inclusive)." + }, + "to": { + "type": "integer", + "description": "Upper bound of the range (inclusive)." + } + }, + "required": [ + "from", + "to" + ] + } + ] + } + }, "connect": { "label": "Attach by connecting to debugpy over a socket.", "properties": { @@ -405,6 +436,37 @@ }, "type": "object" }, + "breakOnSystemExit": { + "description": "Controls which SystemExit exit codes cause the debugger to break. Accepts an array of exit codes and/or inclusive ranges. Set to an empty array to never break on SystemExit. When omitted, the debugger uses its default behavior (break on all non-zero exit codes, ignoring successful exits).", + "type": "array", + "items": { + "oneOf": [ + { + "type": "integer", + "description": "A specific SystemExit code to break on." + }, + { + "type": "object", + "additionalProperties": false, + "description": "An inclusive range of SystemExit codes to break on.", + "properties": { + "from": { + "type": "integer", + "description": "Lower bound of the range (inclusive)." + }, + "to": { + "type": "integer", + "description": "Upper bound of the range (inclusive)." + } + }, + "required": [ + "from", + "to" + ] + } + ] + } + }, "console": { "default": "integratedTerminal", "description": "Where to launch the debug target: internal console, integrated terminal, or external terminal.", diff --git a/src/extension/types.ts b/src/extension/types.ts index 1b007add..37dcb738 100644 --- a/src/extension/types.ts +++ b/src/extension/types.ts @@ -43,6 +43,11 @@ export type PathMapping = { remoteRoot: string; }; +export type SystemExitRange = { + from: number; + to: number; +}; + type Connection = { host?: string; port?: number | string; @@ -69,6 +74,9 @@ interface ICommonDebugArguments { // Show return values of functions while stepping. showReturnValue?: boolean; subProcess?: boolean; + // SystemExit codes (and/or inclusive ranges) that cause the debugger to break. + // An empty array disables breaking on SystemExit entirely. + breakOnSystemExit?: (number | SystemExitRange)[]; // An absolute path to local directory with source. pathMappings?: PathMapping[]; } From 90a13cac334c86a9857f9b552f552bf1a9553a04 Mon Sep 17 00:00:00 2001 From: Rich Chiodo false Date: Wed, 29 Jul 2026 10:10:03 -0700 Subject: [PATCH 2/2] Clarify breakOnSystemExit default behavior in schema description Describe the default as an ignore-list ({0, None}, plus 3 under Django/Flask) that breaks on any other code when uncaught-exception breaking is enabled, rather than the looser 'break on all non-zero exit codes'. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 24c2d34b-15f0-45d2-bd59-8ee042269d20 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index abf77e5c..bb66e0dd 100644 --- a/package.json +++ b/package.json @@ -187,7 +187,7 @@ "type": "object" }, "breakOnSystemExit": { - "description": "Controls which SystemExit exit codes cause the debugger to break. Accepts an array of exit codes and/or inclusive ranges. Set to an empty array to never break on SystemExit. When omitted, the debugger uses its default behavior (break on all non-zero exit codes, ignoring successful exits).", + "description": "Controls which SystemExit exit codes cause the debugger to break. Accepts an array of exit codes and/or inclusive ranges. Set to an empty array to never break on SystemExit. When omitted, the debugger's default applies: successful exits (SystemExit(0) and SystemExit(None), plus 3 under Django/Flask) are ignored, and any other code causes a break when uncaught-exception breaking is enabled.", "type": "array", "items": { "oneOf": [ @@ -437,7 +437,7 @@ "type": "object" }, "breakOnSystemExit": { - "description": "Controls which SystemExit exit codes cause the debugger to break. Accepts an array of exit codes and/or inclusive ranges. Set to an empty array to never break on SystemExit. When omitted, the debugger uses its default behavior (break on all non-zero exit codes, ignoring successful exits).", + "description": "Controls which SystemExit exit codes cause the debugger to break. Accepts an array of exit codes and/or inclusive ranges. Set to an empty array to never break on SystemExit. When omitted, the debugger's default applies: successful exits (SystemExit(0) and SystemExit(None), plus 3 under Django/Flask) are ignored, and any other code causes a break when uncaught-exception breaking is enabled.", "type": "array", "items": { "oneOf": [