github / github/copilot-cli

[Bug] 1.0.49 regression: TUI rendering lag inside tmux on mintty/Cygwin

Offen
#3,439 8 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area:platform-windows area:terminal-rendering
Vorherrschende Sprache
Shell
Sterne
11.2k
Forks
1.9k
Ø Merge
14 Std. 16 Min.
Gemergte PRs (30 T.)
6

Beschreibung

### 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_

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, copilot CLI 1.0.49 in einem Cygwin mintty tmux-Pane zu reproduzieren und seine pty-Ausgabe mit 1.0.48 zu vergleichen. Untersuche die BSU/ESU-Synchronisierungsframes und die darauf folgenden nicht umhüllten Chunks; die Korrektur ist abgeschlossen, wenn Streaming-Ausgabe, Spinner und Cursor in tmux flüssig bleiben.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
shell
Bereich
cli
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.