Repository navigation
Description
Does this issue occur when all extensions are disabled?: No (requires GitHub Copilot Chat / Agent Mode)
- VS Code Version:
1.142.0-insider(commitd5dfbe9aa2c84cc3cbc3d4926a5155983aceeef1or 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:
- The terminal remains completely hidden in the background without any tab appearing in the Integrated Terminal panel.
- The "Show and Focus Terminal" button is completely absent from the chat tool block toolbar.
- If a script hangs (e.g., a slow
curlloop or server command), there is no way to sendCtrl+Cto that specific command; the user is forced to kill the entire chat turn using the global Chat Stop button.
Steps to Reproduce
- 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
- Observe the chat card while it is running.
- Notice that there is no button or action to reveal/focus the terminal in the integrated terminal panel.
- Try to send
Ctrl+Cor 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:
-
In the Agent Host runtime (
agentHostMain.js), the agent's shell tool now emits tool contents with:{ "type": "terminal", "isPty": false } -
In the workbench chat terminal progress part (
workbench.desktop.main.js), there is an explicit early return whenisPty === false:if (this._terminalData.isPty === false) { this._attachOutputSource(); this._updateToolbarContextKeys(void 0, e); return; }
-
Because
_updateToolbarContextKeys(void 0, e)is invoked withundefinedfor the instance argument,this._toolbarHasInstanceevaluates tofalse:_updateToolbarContextKeys(e, t) { this._toolbarHasInstance = !!e; // Evaluates to false // ... }
-
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:
- 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).
- Send
Ctrl+C(SIGINT) to interrupt individual running commands without aborting the entire conversation turn.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
anthonykim1 commentedon Oct 16, 2026
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+Cthrough 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.
DaniSulam commentedon Oct 21, 2026
This bug is still out and about, cannot focus terminal to stop a lingering process in any way.