mirror of
https://github.com/docker/compose.git
synced 2026-10-12 02:13:08 +00:00
fix(display): reset the screen after degraded out-of-operation lines
A plain line printed outside any operation lands below the tracked block, so the block is no longer directly above the cursor. Reset the screen so the next operation repaints a fresh block instead of moving the cursor over rows that shifted — the same reason unsuspend resets after buildkit output. Suggested-by: Guillaume Lours <[email protected]> Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: Nicolas De Loof <[email protected]>
This commit is contained in:
committed by
Guillaume Lours
co-authored by
Claude Fable 5
parent
1a3bb4f6f5
commit
68d9b510cc
+5
-1
@@ -191,8 +191,12 @@ func (w *termWriter) handle(e api.Resource) {
|
||||
w.tree.apply(e, w.now())
|
||||
|
||||
if w.operation == "" {
|
||||
// outside any operation: degrade to one plain line per event
|
||||
// outside any operation: degrade to one plain line per event. This
|
||||
// prints outside the tracked block, so the next repaint must not
|
||||
// assume the block is still directly above the cursor (same reason
|
||||
// unsuspend resets after buildkit output).
|
||||
_, _ = fmt.Fprintf(w.out, "%s %s %s\n", e.ID, eventColor(e.Status, SuccessColor)(e.Text), e.Details)
|
||||
w.scr.reset()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user