mirror of
https://github.com/docker/compose.git
synced 2026-11-17 05:36:08 +00:00
The TTY renderer accumulated display-corruption fixes (truncation of details, then progress sizes, then task ids; timer alignment; rune-based measurement) that each patched one symptom of the same structural gap: nothing guaranteed a rendered line fits the terminal, and once a line wraps, cursor arithmetic desyncs and the block corrupts. Replace it with three separable units: - tty_model.go: pure event reducer with an injected clock, preserving first-parent-wins updates, monotonic progress and header counters - tty_layout.go: pure (model, size, now) -> lines function; all widths are measured in terminal cells (go-runewidth, so CJK is correct) on plain text before coloring, and every line is clipped to the terminal width by construction, status text included - tty_screen.go: diff-based repaint; unchanged rows are skipped, identical frames write nothing, a frame is a single Write; a shrinking terminal abandons the block instead of moving the cursor over reflowed rows The writer coordinates them behind a mutex and stops the refresh goroutine through context cancellation, so Done cannot block when the operation context was cancelled first (Ctrl-C during pull). The spinner frame is derived from the clock instead of advancing on every call, and truncation can no longer split multi-byte runes. Visual output is unchanged: the snapshot test reproduces the previous renderer's golden output character for character. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com> |
||
|---|---|---|
| .. | ||
| alpha.go | ||
| attach.go | ||
| backend.go | ||
| bridge.go | ||
| bridge_test.go | ||
| build.go | ||
| build_test.go | ||
| commit.go | ||
| completion.go | ||
| compose.go | ||
| compose_oci_test.go | ||
| compose_progress_test.go | ||
| compose_test.go | ||
| config.go | ||
| config_test.go | ||
| cp.go | ||
| create.go | ||
| down.go | ||
| events.go | ||
| exec.go | ||
| export.go | ||
| generate.go | ||
| hooks.go | ||
| hooks_test.go | ||
| images.go | ||
| kill.go | ||
| list.go | ||
| logs.go | ||
| options.go | ||
| options_test.go | ||
| pause.go | ||
| port.go | ||
| ps.go | ||
| publish.go | ||
| pull.go | ||
| pullOptions_test.go | ||
| push.go | ||
| remove.go | ||
| restart.go | ||
| run.go | ||
| scale.go | ||
| start.go | ||
| stats.go | ||
| stop.go | ||
| top.go | ||
| top_test.go | ||
| unsupported_attributes.go | ||
| unsupported_attributes_test.go | ||
| up.go | ||
| up_test.go | ||
| version.go | ||
| version_test.go | ||
| viz.go | ||
| viz_test.go | ||
| volumes.go | ||
| wait.go | ||
| watch.go | ||