From d22426c8514eca5ac06f961853af8a0bd16b4eac Mon Sep 17 00:00:00 2001 From: summerelm <314874026+summerelm@users.noreply.github.com> Date: Sun, 22 Nov 2026 11:48:43 +1100 Subject: [PATCH] Fix terminateDebuggee capability advertised by debugpy --- src/debugpy/adapter/clients.py | 2 +- tests/debugpy/adapter/test_clients.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/debugpy/adapter/clients.py b/src/debugpy/adapter/clients.py index dd8e224a9..f2fd81484 100644 --- a/src/debugpy/adapter/clients.py +++ b/src/debugpy/adapter/clients.py @@ -192,7 +192,7 @@ def initialize_request(self, request): "supportsSetExpression": True, "supportsSetVariable": True, "supportsValueFormattingOptions": True, - "supportsTerminateDebuggee": True, + "supportTerminateDebuggee": True, "supportsTerminateRequest": True, "supportsGotoTargetsRequest": True, "supportsClipboardContext": True, diff --git a/tests/debugpy/adapter/test_clients.py b/tests/debugpy/adapter/test_clients.py index 89ffc59b4..35e89fb8d 100644 --- a/tests/debugpy/adapter/test_clients.py +++ b/tests/debugpy/adapter/test_clients.py @@ -51,6 +51,22 @@ class _FakeServer(object): channel = _UnpropagatingChannel() +def test_initialize_advertises_terminate_debuggee(): + stream = _MemoryStream() + channel = messaging.JsonMessageChannel(stream, None) + + client = clients.Client.__new__(clients.Client) + client.session = _FakeSession() + client._initialize_request = None + request = messaging.Request( + channel, 1, "initialize", messaging.MessageDict(None, {}) + ) + + capabilities = client.initialize_request(request) + + assert capabilities["supportTerminateDebuggee"] is True + + def _make_client(start_request, has_started): stream = _MemoryStream() channel = messaging.JsonMessageChannel(stream, None)