From 1b13d6f695e8f8954d2c5203a24cb9854f4f896a Mon Sep 17 00:00:00 2001 From: Nbiba Bedis Date: Mon, 24 Jan 2022 16:37:41 +0100 Subject: [PATCH] Kepp the cursor on the right terminal side --- src/draw_target.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/draw_target.rs b/src/draw_target.rs index 2803a0d3..7eef0d7d 100644 --- a/src/draw_target.rs +++ b/src/draw_target.rs @@ -396,6 +396,10 @@ impl ProgressDrawState { } else { // Don't append a '\n' if this is the last line term.write_str(line)?; + // Keep the cursor on the right terminal side + // So that next user writes/prints will happen on the next line + let line_width = console::measure_text_width(line); + term.move_cursor_right(usize::from(term.size().1) - line_width)?; } } Ok(())