mirror of
https://github.com/nushell/nushell.git
synced 2024-11-22 16:33:37 +01:00
Trim newline from input
results (#5097)
This commit is contained in:
parent
6e7e2dbb97
commit
d0e636ae7a
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user