diff --git a/src/uu/more/src/more.rs b/src/uu/more/src/more.rs index 2b6bde9da..08e6fdd70 100644 --- a/src/uu/more/src/more.rs +++ b/src/uu/more/src/more.rs @@ -333,9 +333,14 @@ fn more( _ => continue, } - if options.clean_print { - execute!(std::io::stdout(), Clear(ClearType::Purge), MoveTo(0, 0)).unwrap(); - } else if options.print_over { + if options.print_over { + execute!( + std::io::stdout(), + MoveTo(0, 0), + Clear(ClearType::FromCursorDown) + ) + .unwrap(); + } else if options.clean_print { execute!(std::io::stdout(), Clear(ClearType::All), MoveTo(0, 0)).unwrap(); } pager.draw(stdout, wrong_key); diff --git a/tests/by-util/test_more.rs b/tests/by-util/test_more.rs index 80d3c3da4..bffa88cab 100644 --- a/tests/by-util/test_more.rs +++ b/tests/by-util/test_more.rs @@ -13,11 +13,11 @@ fn test_more_no_arg() { #[test] fn test_valid_arg() { if std::io::stdout().is_terminal() { - new_ucmd!().arg("-c").succeeds().code_is(0); - new_ucmd!().arg("--print-over").succeeds().code_is(0); + new_ucmd!().arg("-c").succeeds(); + new_ucmd!().arg("--print-over").succeeds(); - new_ucmd!().arg("-p").succeeds().code_is(0); - new_ucmd!().arg("--clean-print").succeeds().code_is(0); + new_ucmd!().arg("-p").succeeds(); + new_ucmd!().arg("--clean-print").succeeds(); } else { } }