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

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>
This commit is contained in:
Carlos Alexandro Becker 2024-12-10 21:27:13 -03:00 committed by GitHub
commit b0c9c58302
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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.