Skip to content

Agent Mode: Missing "Show and Focus Terminal" button and inability to interrupt (Ctrl+C) running commands due to isPty: false #341333

Closed as not planned

Description

@nestpana

Does this issue occur when all extensions are disabled?: No (requires GitHub Copilot Chat / Agent Mode)

  • VS Code Version: 1.142.0-insider (commit d5dfbe9aa2c84cc3cbc3d4926a5155983aceeef1 or latest)
  • OS Version: Linux x64

Description

In recent builds of VS Code Insiders with Copilot Agent Mode, when the agent executes shell commands, there is no longer any way to view, focus, or interact with the running terminal.

Previously, when an agent ran a command, there was a "Show and Focus Terminal" button (or pop-out icon openInProduct) on the chat tool card. This allowed the user to reveal the integrated terminal panel, watch live stdout/stderr, and send Ctrl+C (SIGINT) to abort scripts that hang, loop indefinitely, or fail.

Currently:

  1. The terminal remains completely hidden in the background without any tab appearing in the Integrated Terminal panel.
  2. The "Show and Focus Terminal" button is completely absent from the chat tool block toolbar.
  3. If a script hangs (e.g., a slow curl loop or server command), there is no way to send Ctrl+C to that specific command; the user is forced to kill the entire chat turn using the global Chat Stop button.

Steps to Reproduce

  1. In VS Code Insiders Copilot Chat (Agent Mode), ask Copilot to run a long-running shell command:
    for i in {1..12}; do echo "hello world"; sleep 5; done
  2. Observe the chat card while it is running.
  3. Notice that there is no button or action to reveal/focus the terminal in the integrated terminal panel.
  4. Try to send Ctrl+C or access the running process — it is impossible without canceling the entire agent session.

Root Cause Analysis in Codebase

Inspecting the compiled workbench source reveals why this button disappeared:

  1. In the Agent Host runtime (agentHostMain.js), the agent's shell tool now emits tool contents with:

    {
      "type": "terminal",
      "isPty": false
    }
  2. In the workbench chat terminal progress part (workbench.desktop.main.js), there is an explicit early return when isPty === false:

    if (this._terminalData.isPty === false) {
        this._attachOutputSource();
        this._updateToolbarContextKeys(void 0, e);
        return;
    }
  3. Because _updateToolbarContextKeys(void 0, e) is invoked with undefined for the instance argument, this._toolbarHasInstance evaluates to false:

    _updateToolbarContextKeys(e, t) {
        this._toolbarHasInstance = !!e; // Evaluates to false
        // ...
    }
  4. Consequently, the block that instantiates and pushes FocusChatInstanceAction ("Show and Focus Terminal" / Codicon.openInProduct) is completely skipped:

    if (this._toolbarHasInstance) {
        let title = this._toolbarIsHiddenTerminal 
            ? localize('showAndFocusTerminal', "Show and Focus Terminal") 
            : localize('focusTerminal', "Focus Terminal");
        let action = new Action(
            sx.FocusChatInstanceAction,
            title,
            ThemeIcon.asClassName(Codicon.openInProduct),
            true,
            () => this.focusTerminal()
        );
        this._actionBarActions.add(action);
        actions.push(action);
    }

Expected Behavior

Users should be able to:

  1. Reveal and focus the executing terminal stream in the integrated terminal panel (or have an option/setting to run agent commands via an interactive PTY).
  2. Send Ctrl+C (SIGINT) to interrupt individual running commands without aborting the entire conversation turn.

Activity

  1. added
    agent-host
    on Oct 16, 2026
  2. added and removed
    agent-host
    on Oct 16, 2026
  3. anthonykim1 commented on Oct 16, 2026

    @anthonykim1
    Contributor

    Thanks for the detailed report. The Copilot SDK’s built-in shell tool is non-PTY-backed, so it does not create an Integrated Terminal instance that VS Code can reveal or focus, and it cannot receive Ctrl+C through terminal input.

    Once a command is running as a background shell, however, you should be able to terminate that shell without stopping the entire chat turn.

    Could you update to the latest VS Code Insiders build and let us know whether that background-shell termination flow provides the interruption behavior you’re looking for?

    https://code.visualstudio.com/insiders/

    If not, please let us know what part of the workflow is still missing.

  4. DaniSulam commented on Oct 21, 2026

    @DaniSulam

    This bug is still out and about, cannot focus terminal to stop a lingering process in any way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions