From aaea06dd98508d58da1e743cd204829d09e18c19 Mon Sep 17 00:00:00 2001 From: cloudhead Date: Tue, 26 Mar 2024 13:13:54 +0100 Subject: [PATCH] term: Fix spinner output on certain platforms --- radicle-term/src/spinner.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/radicle-term/src/spinner.rs b/radicle-term/src/spinner.rs index 731b77bbe..3a6564e5a 100644 --- a/radicle-term/src/spinner.rs +++ b/radicle-term/src/spinner.rs @@ -143,8 +143,8 @@ pub fn spinner_to( write!( animation, - "{}{spinner} {message}\r", - termion::clear::AfterCursor, + "\r{}{spinner} {message}", + termion::clear::UntilNewline, ) .ok(); @@ -155,7 +155,7 @@ pub fn spinner_to( state: State::Done, message, } => { - write!(animation, "{}", termion::clear::AfterCursor).ok(); + write!(animation, "\r{}", termion::clear::UntilNewline).ok(); writeln!(completion, "{} {message}", Paint::green("✓")).ok(); break; } @@ -163,7 +163,7 @@ pub fn spinner_to( state: State::Canceled, message, } => { - write!(animation, "{}", termion::clear::AfterCursor).ok(); + write!(animation, "\r{}", termion::clear::UntilNewline).ok(); writeln!( completion, "{ERROR_PREFIX} {message} {}", @@ -176,6 +176,7 @@ pub fn spinner_to( state: State::Warn, message, } => { + write!(animation, "\r{}", termion::clear::UntilNewline).ok(); writeln!(completion, "{WARNING_PREFIX} {message}").ok(); break; } @@ -183,6 +184,7 @@ pub fn spinner_to( state: State::Error, message, } => { + write!(animation, "\r{}", termion::clear::UntilNewline).ok(); writeln!(completion, "{ERROR_PREFIX} {message}").ok(); break; }