Trim newline from input results (#5097)

This commit is contained in:
Reilly Wood 2022-04-05 10:52:09 -07:00 committed by GitHub
parent 6e7e2dbb97
commit d0e636ae7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,8 +121,14 @@ impl Command for Input {
.into_pipeline_data());
}
// Just read a normal line of text
// Just read a normal line of text, and trim the newline at the end
let input = std::io::stdin().read_line(&mut buf);
if buf.ends_with('\n') {
buf.pop();
if buf.ends_with('\r') {
buf.pop();
}
}
match input {
Ok(_) => Ok(Value::String {