Repository navigation
Severe scroll lag in VSCode/Cursor integrated terminal on WSL2 after large output (unusable for minutes) #7893
Description
Description
OpenCode becomes completely unusable in VSCode/Cursor integrated terminal on WSL2 after outputting a moderate amount of content. Scrolling freezes for tens of seconds to several minutes, making the application practically unusable. However, running the same OpenCode version in Windows Terminal + WSL works perfectly.
Environment
| Component | Version |
|---|---|
| OpenCode | 1.1.13 |
| OS | Windows 11 |
| WSL | 2.6.3 |
| WSL Distro | Ubuntu 24.04.2 LTS |
| Cursor | 2.3.34 (VSCode 1.105.1) |
| VSCode | 1.105.1 (same issue) |
| Windows Terminal | Works normally |
Steps to Reproduce
- Open Cursor or VSCode on Windows 11
- Connect to WSL2 environment
- Run
opencodein the integrated terminal - Ask a question that generates a long response
- Try to scroll up/down during or after the output
- Observe: scrolling becomes extremely laggy (tens of seconds to minutes of delay)
Additional reproduction path:
- Use
/sessionto restore a previous session - Scroll up and down a few times quickly
- Observe: after a few scroll operations, the lag appears
Expected Behavior
Scrolling should be smooth and responsive, similar to the experience in Windows Terminal.
Actual Behavior
| Scenario | Behavior |
|---|---|
| During LLM streaming | Almost impossible to scroll, UI freezes |
| After output completes | Scroll lag of 10-60+ seconds |
After restoring session via /session |
Initially OK, then severe lag after a few scroll operations |
| In Windows Terminal + WSL | ✅ Works perfectly, no lag |
Key Observation
The same OpenCode version (1.1.13) works perfectly when running through:
- PowerShell →
wsl→opencode - Windows Terminal → WSL →
opencode
This strongly suggests the issue is specific to xterm.js-based integrated terminals (VSCode/Cursor) combined with OpenTUI's rendering on WSL2.
Likely Related Issues
| Issue | Relevance |
|---|---|
| #5361 | WSL2 TUI freeze regression (v1.0.129+) - similar root cause |
| #6172 | O(n) text buffer rendering causing high CPU - explains why large output triggers lag |
| #7316 | Mouse wheel stops working on Windows Terminal - possibly related input handling issue |
| #5168 | SIGPWR signal storm in WSL2 - another WSL2-specific issue |
Potentially Related PRs
These PRs appear to address the underlying performance issues:
- perf(tui/chat): virtualize message rendering to remove O(n) reflows during streaming #3346 - Virtualize message rendering to remove O(n) reflows
- perf(tui): Eliminate O(n) scans from render hot path for smooth animations #2867 - Eliminate O(n) scans from render hot path
Workaround
Currently using Windows Terminal + WSL as a workaround, which works normally.
Additional Context
This issue makes OpenCode essentially unusable for daily development in Cursor/VSCode on WSL2, which is a very common development environment. The fact that Windows Terminal works fine suggests this is fixable with rendering optimizations for xterm.js-based terminals.
Would be happy to provide additional diagnostic information (strace, performance profiles, etc.) if needed.
OpenCode version
1.1.13
Operating System
Windows 11 + WSL2 2.6.3 + Ubuntu 24.04.2 LTS
Terminal
Cursor 2.3.34 / VSCode 1.105.1 integrated terminal (both affected)
Activity
github-actions commentedon Jan 12, 2026
This issue might be a duplicate of existing issues. Please check:
The issue specifically mentions xterm.js-based terminals (VSCode/Cursor integrated terminal) vs Windows Terminal working fine. This strongly suggests the root cause is OpenTUI's rendering pipeline not being optimized for xterm.js.
Feel free to ignore if your specific case differs from these issues.
git-qiaozq commentedon Jan 12, 2026
Update: Tested with v1.0.128 - Issue Still Exists
I downgraded to OpenCode v1.0.128 (the version before the WSL2 freeze regression in #5361), but the scroll lag issue persists.
This confirms that:
Test Results
This suggests the performance issue with xterm.js-based integrated terminals has existed for a while and is independent of the v1.0.129 opentui update.
hieudtr8 commentedon Jan 21, 2026
Got same issues on Windows 10 with Cursor/Vscode IDE
github-actions commentedon Mar 28, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.