Describe the bug
Summary
Running npx vitest run for a full test suite hangs indefinitely when executed through the GitHub Copilot CLI terminal. The same command works fine in a regular PowerShell/cmd terminal.
Environment
- Tool: GitHub Copilot CLI (VS Code)
- OS: Windows
- Node: v22.14.0
- npm: 10.9.2
- Vitest: v4.1.2
Reproduction Steps
- Open a Copilot CLI terminal session in VS Code
- Run
npx vitest run
- Vitest starts, queues all test files, runs a few, then hangs with no further output
- Typically nothing is seen piped back to the session window (the above has been deduced)
What Works
- Running a single test file works fine:
npx vitest run some.test.ts
- Running batches of up to ~10 files works fine
- Running with JSON output to file works and completes successfully:
npx vitest run --reporter=json --outputFile=test-results.json
Root Cause
According to copilot which tried to diagnose this:
Vitest's default live reporter continuously rewrites terminal output using ANSI escape sequences (cursor movement, line clearing) for all queued files simultaneously. This high-volume ANSI output appears to overflow or deadlock the Copilot CLI's stdout pipe, causing the process to hang.
Redirecting output to a file bypasses the pipe entirely and the suite completes normally.
Workaround
npx vitest run --reporter=json --outputFile=test-results.json
Suggested Fix
Affected version
vs code 1.120.0
Steps to reproduce the behavior
- Open a Copilot CLI terminal session in VS Code
- Run
npx vitest run
- Vitest starts, queues all test files, runs a few, then hangs with no further output
- Typically nothing is seen piped back to the session window (the above has been deduced)
Expected behavior
See output of vitest
Additional context
No response
Describe the bug
Summary
Running
npx vitest runfor a full test suite hangs indefinitely when executed through the GitHub Copilot CLI terminal. The same command works fine in a regular PowerShell/cmd terminal.Environment
Reproduction Steps
npx vitest runWhat Works
npx vitest run some.test.tsRoot Cause
According to copilot which tried to diagnose this:
Vitest's default live reporter continuously rewrites terminal output using ANSI escape sequences (cursor movement, line clearing) for all queued files simultaneously. This high-volume ANSI output appears to overflow or deadlock the Copilot CLI's stdout pipe, causing the process to hang.
Redirecting output to a file bypasses the pipe entirely and the suite completes normally.
Workaround
Suggested Fix
Affected version
vs code 1.120.0
Steps to reproduce the behavior
npx vitest runExpected behavior
See output of vitest
Additional context
No response