[Bug] 1.0.49 regression: TUI rendering lag inside tmux on mintty/Cygwin
- 主要语言
- Shell
- 星标
- 11.2k
- 派生
- 1.9k
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 6
描述
### Describe the bug
## Summary
The TUI in copilot CLI 1.0.49 renders with severe lag (bursts then freezes, spinner stutter, "stuck until keypress") when run inside a tmux pane on Cygwin/Windows. Versions **1.0.43 and 1.0.48 do not have this problem**. The regression seems to have been introduced in 1.0.49.
The problem disappears when copilot is run directly in mintty without tmux, so this is specific to copilot's interaction with tmux's pane render pipeline.
## Environment
- Windows 11
- Cygwin 3.6.9 (mintty 3.8.2)
- tmux next-3.4 (Cygwin package, ~Jan 2024 snapshot of post-3.3a)
- Also reproduces on tmux 3.6b built from upstream
## Reproduction
1. From a Cygwin mintty inside a tmux session, launch copilot:
2. Send a couple of prompts that produce streaming output (e.g. "list 1 to 100, one per line").
3. Observe: output arrives in bursts, the spinner stutters, the cursor occasionally freezes until a keypress.
## Bisection result
Same machine, same tmux pane, same prompt:
| Version | Behavior |
|---|---|
| 1.0.43 | smooth |
| 1.0.48 | smooth |
| 1.0.49 | laggy (all symptoms above) |
## Byte-stream analysis
Captured copilot's pty output via `tmux pipe-pane -O` while it produced ~30KB over ~7 seconds:
- 232 distinct chunks; mean chunk size 116 bytes; chunk-rate ~31/sec
- 87 BSU/ESU pairs (`ESC[?2026h ... ESC[?2026l`) emitted — but **all 87 are empty**: zero bytes between the BSU and the matching ESU. Confirmed by regex extraction:
```
unique sync frame contents: 1 (the empty bytestring b'')
```
- The actual screen-update content (cursor movements, color codes, text) arrives in **separate, unwrapped chunks** afterward, with inter-chunk gaps up to 226ms (p95: 102ms).
In other words: copilot announces a synchronized update (`BSU` then `ESU` immediately), then writes the real frame content in subsequent unframed chunks. Tmux faithfully renders each unframed chunk independently. The mode-2026 sync mechanism is being emitted but is not actually wrapping any content.
For comparison, equivalent bash and PowerShell output through the same tmux pane is smooth. Those producers send append-only line-oriented output and don't trigger this rendering pattern.
## Workaround
Downgrade to 1.0.48
### Affected version
_No response_
### Steps to reproduce the behavior
_No response_
### Expected behavior
_No response_
### Additional context
_No response_
贡献指南
调研方向
Start by reproducing copilot CLI 1.0.49 in a Cygwin mintty tmux pane and compare its pty output with 1.0.48. Inspect the BSU/ESU synchronization frames and subsequent unwrapped chunks; the fix is complete when streaming output, the spinner, and cursor remain smooth in tmux.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- shell
- 领域
- cli
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100