Skip to content

Commit

Permalink
fix: renderer: reset the cursor on the first line
Browse files Browse the repository at this point in the history
We need to reset the cursor position on the first line before rendering.
Otherwise, it might mess up the first line being rendered.

Fixes: #1000
Fixes: 4624106 (feat: reduce console/term dependencies (#897))
  • Loading branch information
aymanbagabas committed May 8, 2024
1 parent e3c6153 commit c7e2315
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions standard_renderer.go
Expand Up @@ -232,6 +232,12 @@ func (r *standardRenderer) flush() {
out.CursorDown(1)
}
} else {
if i == 0 {
// Reset the cursor to the start of the line before writing the
// first line.
buf.WriteByte('\r')
}

line := newLines[i]

// Truncate lines wider than the width of the window to avoid
Expand Down

0 comments on commit c7e2315

Please sign in to comment.