Skip to content
Myr

fix(stdin): trim space instead of \n (#761)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

we were trimming an ending \n, but it would then break a \r\n sequence, causing misrenders. this fixes it closes #682

authored by Carlos Alexandro Becker · committed by GitHub · parent 8d611cb · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:internal/stdin/stdin.go+1 added-1 removed
28 unmodified lines
29 return "", fmt.Errorf("failed to write rune: %w", err)30 }31 }3233 return strings.TrimSuffix(b.String(), "\n"), nil33 return strings.TrimSpace(b.String()), nil34}3536// ReadStrip reads input from an stdin pipe and strips ansi sequences.37func ReadStrip() (string, error) {
17 unmodified lines