Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
term: Fix spinner output on certain platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudhead committed Mar 26, 2024
1 parent f01aac8 commit aaea06d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions radicle-term/src/spinner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ pub fn spinner_to(

write!(
animation,
"{}{spinner} {message}\r",
termion::clear::AfterCursor,
"\r{}{spinner} {message}",
termion::clear::UntilNewline,
)
.ok();

Expand All @@ -155,15 +155,15 @@ 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;
}
Progress {
state: State::Canceled,
message,
} => {
write!(animation, "{}", termion::clear::AfterCursor).ok();
write!(animation, "\r{}", termion::clear::UntilNewline).ok();
writeln!(
completion,
"{ERROR_PREFIX} {message} {}",
Expand All @@ -176,13 +176,15 @@ pub fn spinner_to(
state: State::Warn,
message,
} => {
write!(animation, "\r{}", termion::clear::UntilNewline).ok();
writeln!(completion, "{WARNING_PREFIX} {message}").ok();
break;
}
Progress {
state: State::Error,
message,
} => {
write!(animation, "\r{}", termion::clear::UntilNewline).ok();
writeln!(completion, "{ERROR_PREFIX} {message}").ok();
break;
}
Expand Down

0 comments on commit aaea06d

Please sign in to comment.