From 4873c8a24b7e00283572f05da18e3b74a6819562 Mon Sep 17 00:00:00 2001 From: Kevin Burke Date: Tue, 23 Mar 2021 13:49:35 -0700 Subject: [PATCH] mv: ensure line prints (#1890) Previously this used `print` instead of `println`, and as a result the prompt would never appear and the command would hang. The Rust docs note this about print: > Note that stdout is frequently line-buffered by default so it may be > necessary to use io::stdout().flush() to ensure the output is emitted > immediately. Changing to `println` fixes the issue. Fixes #1889. Co-authored-by: Kevin Burke --- src/uu/mv/src/mv.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uu/mv/src/mv.rs b/src/uu/mv/src/mv.rs index 6575ad37a..b481aeebc 100644 --- a/src/uu/mv/src/mv.rs +++ b/src/uu/mv/src/mv.rs @@ -380,7 +380,7 @@ fn rename(from: &PathBuf, to: &PathBuf, b: &Behavior) -> io::Result<()> { match b.overwrite { OverwriteMode::NoClobber => return Ok(()), OverwriteMode::Interactive => { - print!("{}: overwrite ‘{}’? ", executable!(), to.display()); + println!("{}: overwrite ‘{}’? ", executable!(), to.display()); if !read_yes() { return Ok(()); }