Skip to content

Commit

Permalink
fix(stdin): trim space instead of \n (#761)
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 <[email protected]>
  • Loading branch information
caarlos0 authored Dec 11, 2024
1 parent 8d611cb commit b0c9c58
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 b0c9c58

Please sign in to comment.