Skip to content

Commit

Permalink
fix(stdin): trim space instead of \n
Browse files Browse the repository at this point in the history
we were trimming an ending \n, but it would then break a \r\n sequence, causing misrenders.

this fixes it

closes #682

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
  • Loading branch information
caarlos0 committed Dec 10, 2024
1 parent 2b090e8 commit 71870ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/stdin/stdin.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func Read() (string, error) {
}
}

return strings.TrimSuffix(b.String(), "\n"), nil
return strings.TrimSpace(b.String()), nil
}

// ReadStrip reads input from an stdin pipe and strips ansi sequences.
Expand Down

0 comments on commit 71870ed

Please sign in to comment.