Skip to content

DAP: support the terminateThreads request #2113

Closed

Description

@lagergren

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) advertise false.
  • 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 action DAP.TerminateThread, shown when the client has the capability.
  • The action sends terminateThreads with 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 only DAPExecutionStack knows the thread ID, so DAPStackFrame would need to keep it. 2026.3 also has XDebugger.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 thread events with reason exited, which refreshThread handles. If the ended thread is the stopped one, the adapter's continued or stopped takes 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

  1. added
    enhancement
    dap
    on Nov 22, 2026
  2. added this to the 0.30.2 milestone on Nov 23, 2026
  3. lagergren commented on Nov 24, 2026

    @lagergren
    CollaboratorAuthor

    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).

  4. added a commit that references this issue on Nov 24, 2026
    b8af1f8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    UIdapenhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions