Repository navigation
Closed
Labels
Milestone
Description
What
The terminateThreads request takes threadIds and is gated by the capability supportsTerminateThreadsRequest.
Why
None of the ten adapters checked supports it:
- debugpy (pydevd) and vscode-js-debug (
debugAdapter.ts:345) advertisefalse. - Delve replies "unsupported" (
server.go:941). - Nothing was found in CodeLLDB, lldb-dap, netcoredbg, rdbg, GDB, MIEngine or java-debug.
So this is only for other adapters, such as in-house ones. VS Code has "Terminate Thread" in the Call Stack menu (debugCommands.ts:54, :361).
Today
A single thread can't be ended from the IDE. ThreadsPanel is a table of the root client's threads, without a context menu.
How it could be done
- Install a popup on the panel's table with
PopupHandler.installPopupMenu(JComponent, ActionGroup, String)(both versions). It holds an actionDAP.TerminateThread, shown when the client has the capability. - The action sends
terminateThreadswith the selected thread IDs, off the EDT. - Optional: also add it to
XDebugger.Frames.Tree.Popup(both versions), for the thread of the current frame. Today onlyDAPExecutionStackknows the thread ID, soDAPStackFramewould need to keep it. 2026.3 also hasXDebugger.Threads.View.Popup, but 2024.2 doesn't; register it only from a 2026.3-only plugin descriptor, or skip it. - After the answer: the adapter sends
threadevents with reasonexited, whichrefreshThreadhandles. If the ended thread is the stopped one, the adapter'scontinuedorstoppedtakes over (DAP: support the Continued event #2106). - Limit: the panel shows only the root client's threads (
DAPDebugProcess.getThreads). - Docs: mark TerminateThreads as supported in DAPSupport.md.
Test
- Unit test: the helper that sends the request, with a Proxy fake server.
- Light platform test: the action's
update()follows the capability.
Effort and risk
Small, low risk. Low priority, since no adapter checked supports it. Open question: ask for confirmation first?
Activity
lagergren commentedon Nov 24, 2026
The two optional parts that #2153 left out are now tracked in #2178 (Terminate Thread in the context menu of the Frames view) and #2179 (in IntelliJ's own Threads view, on 2025.3 and later).
feat: terminate threads from the Threads tab of a DAP debug session