-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Describe the bug
Running MSBuild (via Enter-VsDevShell or directly) through the Copilot CLI's powershell tool causes raw ANSI/VT100 mouse tracking escape sequences to flood the terminal. Every mouse movement or click generates additional output, creating a runaway feedback loop that can freeze and crash the host machine.
MSBuild (or the VS Developer Shell) enables VT mouse tracking (\e[?1003h) and focus reporting (\e[?1004h) on the console. The CLI's PTY doesn't filter these, so the hosting terminal starts sending mouse position reports which get echoed as visible text, creating a feedback loop. Workarounds like cmd /c, Start-Process -WindowStyle Hidden, and file redirection all failed since the ConPTY still propagates VT mode changes.
Affected version
GitHub Copilot CLI 1.0.3-2
Steps to reproduce the behavior
- Launch
copiloton Windows in a directory with an MSBuild project - Run these commands (or ask the agent to build):
$vsPath = "C:\Program Files\Microsoft Visual Studio\18\Enterprise" Import-Module "$vsPath\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation msbuild /nr:false /m /clp:ErrorsOnly SomeProject.proj
- Once the build starts, move the mouse over the terminal or click anywhere in it
- Raw escape sequences flood the output:
[50;76M[I[50;76m[75;69M[75;69m[75;69M[75;69m[75;69M[75;69m[... - Each mouse movement appends more. In my testing, this eventually crashed the host machine.
Expected behavior
MSBuild should run without raw escape sequences leaking into the terminal. The CLI's PTY layer should handle or suppress VT mouse tracking sequences from child processes. Possible approaches:
- Filter
\e[?1003h,\e[?1004h,\e[?1006hfrom PTY output before rendering - Disable
ENABLE_MOUSE_INPUTon the ConPTY when creating shell sessions - Reset terminal modes (
\e[?1003l\e[?1004l\e[?1006l) after each command completes
Additional context
- OS: Windows 11
- CPU architecture: x86_64
- Terminal emulator: Windows Terminal
- Shell: PowerShell 7
- Visual Studio: 2026 Enterprise (v18.2.2), MSBuild 18.0.5
- Impact: Completely blocks using the CLI for C++ and .NET MSBuild projects. The feedback loop can crash the host machine, making it a data-loss risk.