Short version: Terminal output is sometimes not captured (or displayed) consistently in Composer using YOLO and Agent mode in windows. I am able to consistently reproduce the problem using the following prompt in a new session:
Run this command and explain if the output is what you would expect and confirm all lines are present and complete:
python -c “n=50; [print(f’Line {i+1}: ’ + ’ '.join([‘test’]*(i+1))) for i in range(n)]”
On a faster PC I have found I may need to increase n to 100, or have it run the command a few times but the problems eventually occur. (missing lines, blank lines instead of expected text, etc.)
I have had what appears to be the same problem with various terminal commands (git, running scripts with longer outputs, etc) and on occasion it leads to the composer not recognizing that the terminal command has completed and it waits forever (hangs).
I am very curious if anyone else is able to reproduce this problem.
And for fun, after having it run the command at least once, ask it to clear the terminal with ‘cls’. For me it hangs (stops) 100% of the time.
Long version (created with help of Cursor/Claude of course)
# Terminal Output Capture Bug Report
## Overview
Testing of terminal command output capture on Windows reveals several issues with buffering, line count limitations, and formatting. The following test command demonstrates all issues:
```bash
python [-u] -c "n=N; [print(f'Line {i+1}: ' + ' '.join(['test']*(i+1))) for i in range(n)]"
- Replace
N
with line count (test with 20, 50, and 100) -u
flag controls output buffering
Issues and Reproduction
1. Output Capture and Formatting
Without the -u
flag, output capture issues are immediately apparent:
# Without -u: Output is incomplete and inconsistent
python -c "n=20; [print(f'Line {i+1}: ' + ' '.join(['test']*(i+1))) for i in range(n)]"
Using -u
improves the situation but doesn’t solve it completely:
# With -u: Shows more lines but still has issues with higher counts
python -u -c "n=20; [print(f'Line {i+1}: ' + ' '.join(['test']*(i+1))) for i in range(n)]"
Test cases with N=20, 50, and 100 lines demonstrate that:
- Output capture behavior varies significantly based on system performance
- Initial lines display correctly with proper formatting
- As line count increases:
- Text wrapping becomes inconsistent
- Formatting degrades
- Lines may be dropped or truncated
- Performance of the system impacts severity and onset of issues
2. Console Commands
- Commands that manipulate the console (like
cls
) cause the AI agent’s command execution to hang - Issue persists across Windows shells (PowerShell and cmd)
- Composer occasionally hangs waiting for command output that never appears
3. AI Generation Hanging
- AI assistant occasionally hangs during response generation
- Issue has been reported by multiple users
- Appears to be independent of terminal output issues
Environment Details
Version: 0.44.11
VSCode Version: 1.93.1
Commit: fe574d0820377383143b2ea26aa6ae28b3425220
Date: 2025-01-03T07:59:06.361Z
Electron: 30.5.1
Chromium: 124.0.6367.243
Node.js: 20.16.0
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.22631
Shell: PowerShell
Python: 3.12.7
YOLO Mode: Enabled
LLM Model: claude-3.5-sonnet
Composer in agent mode
Additional Notes
- Issues persist across different Windows shells (PowerShell and cmd)
- Output capture issues appear to be related to both buffering and line length
- Line wrapping issues become more severe as line length increases
- Output is inconsistent between runs and varies significantly based on system performance, with slower PCs experiencing more pronounced issues
- Terminal commands that manipulate the console (like
cls
) cause the AI agent’s command execution to hang - Issues persist regardless of terminal window size
- Composer occasionally hangs waiting for command output that never appears
- Problems persist after clean re-install of Cursor
- Issues reproduced on multiple Windows PCs with varying performance characteristics