Skip to content

^C When the copilot agent uses terminal tools #311217

@eternamaze

Description

@eternamaze

Type: Bug

Title

Terminal output appears interrupted (^C) in chat when Copilot agent uses terminal tools, but commands actually succeed


Description

When the Copilot agent executes commands via terminal tools, the output shown in the chat interface sometimes appears as if the process was interrupted (e.g., showing ^C at the prompt).

This leads the agent to believe that the command execution was aborted (SIGINT), even though the command actually completes successfully in the underlying terminal environment.

In reality, the command runs to completion (e.g., build artifacts are produced correctly), and no interruption occurs. The issue seems to be a mismatch between the displayed terminal echo in the chat UI and the actual execution state.


Steps to Reproduce

  1. Enable Copilot / Autopilot mode
  2. Trigger the agent to execute a compound command via terminal tools
  3. Observe the echoed output in the chat interface

Example command (sanitized):

cd "C:\Users\<USER>\Desktop\<PROJECT_PATH>" ; `
$env:PATH = "C:\Users\<USER>\.elan\bin;" + $env:PATH ; `
lake update 2>&1 ; `
Write-Host "--- lake build starting ---" ; `
lake build 2>&1 | Select-Object -Last 10

Expected Behavior

  • The chat interface should reflect the real execution state of the terminal
  • Commands that complete successfully should not appear interrupted
  • The agent should correctly infer successful execution

Actual Behavior

  • The chat interface shows output that appears interrupted (e.g., prompt followed by ^C)

Example echoed output (sanitized):

PS C:\Users\<USER>\Desktop\<PROJECT_PATH>>^C
  • The agent interprets this as a SIGINT interruption
  • The agent repeatedly assumes the terminal is in a broken/interrupted state
  • However, the command has actually completed successfully (e.g., build outputs are present)

Additional Notes

  • The issue appears limited to the display layer / chat interface echo, not the real terminal execution
  • The underlying terminal session does not exhibit interruption behavior
  • The mismatch causes incorrect agent reasoning and error handling
  • Possibly related to PTY buffering, control character rendering, or improper signal state propagation in the terminal tool bridge

Impact

  • Causes persistent incorrect error interpretation by the agent
  • Disrupts automated workflows relying on terminal tools
  • May lead to unnecessary retries, aborted flows, or degraded user experience

VS Code version: Code - Insiders 1.117.0-insider (a947515, 2026-04-17T21:17:44Z)
OS version: Windows_NT x64 10.0.26200
Modes:

System Info
Item Value
CPUs AMD Ryzen 7 9700X 8-Core Processor (16 x 3793)
GPU Status 2d_canvas: enabled
GPU0: VENDOR= 0x10de, DEVICE=0x1c82 [NVIDIA GeForce GTX 1050 Ti], DRIVER_VENDOR=NVIDIA, DRIVER_VERSION=32.0.15.6094 ACTIVE
GPU1: VENDOR= 0x1002, DEVICE=0x13c0 [AMD Radeon(TM) Graphics], DRIVER_VERSION=32.0.11024.2
GPU2: VENDOR= 0x1414, DEVICE=0x008c [Microsoft Basic Render Driver], DRIVER_VERSION=10.0.26100.8246
Machine model name:
Machine model version:
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 31.16GB (11.46GB free)
Process Argv --crash-reporter-id d433f010-c031-41ad-a4e3-d83c9aa94595
Screen Reader no
VM 0%
Extensions (48)
Extension Author (truncated) Version
vscode-eslint dba 3.0.24
codespaces Git 1.18.12
remotehub Git 0.65.2026031901
vscode-github-actions git 0.31.3
vscode-pull-request-github Git 0.137.2026041704
go gol 0.53.1
todo-tree Gru 0.0.226
lean4 lea 0.0.234
vscode-mermaid-chart Mer 2.6.4
vscode-containers ms- 2.4.1
vscode-language-pack-zh-hans MS- 1.110.2026041514
debugpy ms- 2026.3.2026032701
python ms- 2026.5.2026032701
vscode-pylance ms- 2026.2.100
vscode-python-envs ms- 1.29.2026041601
jupyter ms- 2025.10.2026040301
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.3.2025062701
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
remote-containers ms- 0.456.0
remote-ssh ms- 0.123.2026033115
remote-ssh-edit ms- 0.87.0
remote-wsl ms- 0.104.3
vscode-remote-extensionpack ms- 0.26.0
azure-repos ms- 0.41.2026031901
cmake-tools ms- 1.24.1
cpp-devtools ms- 0.5.5
cpptools ms- 1.32.0
cpptools-extension-pack ms- 1.5.1
hexeditor ms- 1.11.1
makefile-tools ms- 0.13.23
powershell ms- 2026.1.0
remote-explorer ms- 0.6.2026031809
remote-repositories ms- 0.43.2026031901
remote-server ms- 1.6.2026041509
vscode-github-issue-notebooks ms- 0.0.134
java red 1.55.2026041708
rust-analyzer rus 0.4.2868
even-better-toml tam 0.21.2
vscode-gradle vsc 3.17.2026040802
vscode-java-debug vsc 0.59.0
vscode-java-dependency vsc 0.27.2
vscode-java-pack vsc 0.30.2025111702
vscode-java-test vsc 0.45.0
vscode-maven vsc 0.45.2025120808
volar Vue 3.2.6
luahelper yin 0.2.29

(1 theme extensions excluded)

A/B Experiments
vsliv368cf:30146710
pythonvspyt551cf:31249598
nativeloc1:31118317
dwcopilot:31158714
dwoutputs:31242946
copilot_t_ci:31333650
g012b348:31231168
pythonrdcb7:31268811
pythonpcpt1cf:31399617
6518g693:31302842
63221493:31336333
envsactivate1:31349248
editstats-enabled:31346256
cloudbuttont:31366566
3efgi100_wstrepl:31403338
use-responses-api:31390341
je187915:31401257
cp_cls_t_966_ss:31454198
inlinechat_v2_hd992725:31445440
4je02754:31455664
c3h7c220:31478652
ge8j1254_inline_auto_hint_haiku:31490507
cp_cls_t_1081:31454832
conptydll_true:31485575
ia-use-proxy-models-svc:31446143
e9c30283:31453065
test_treatment2:31471001
46204921:31447328
rl_a_098a3278:31491248
idci7584:31454084
nes_chat_context_enabled:31451401
e3e4d672:31454087
ei9d7968:31462942
534a6447:31478742
7ef87755:31455235
nes-extended-on:31455475
jc933416:31462667
89g7j272:31480197
hhf17803:31462392
7e187181:31482583
cpptoolson-v2:31475363
i2gc6536:31472020
1g3cj959:31494704
h08i8180_copy:31475366
23c7c724:31491644
client_tst_t:31486874
po_split_t:31488387
ddid_c:31478205
hmra_i5g22:31494995
getcmakediagnosticsoff:31489825
g_20_d1382936:31492258
bjc72774_agent_sandbox:31488290
7df3h592:31491241
pro_conc_t:31484702
41e7a136_t:31485218
cp_cls_c_1082:31491634
719di409_sum_t:31497466
f5b8g904_t:31494277
nes-cj-befline:31490295
logging_enabled_new:31490725
nes-ew-div-ctrl:31494904

Metadata

Metadata

Assignees

Labels

staleIssues that have not been triaged in an appropriate amount of timetriage-needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions