term: Use `\r` for spinner

The save/restore cursor escape sequences from `termion` do not work on
macOS.
This commit is contained in:
cloudhead 2023-10-11 09:34:07 +02:00
parent 499738de71
commit 7c842bcc1d
No known key found for this signature in database
1 changed files with 1 additions and 4 deletions

View File

@ -137,14 +137,11 @@ pub fn spinner_to(
write!( write!(
animation, animation,
"{}{}{spinner} {message}", "{}{spinner} {message}\r",
termion::cursor::Save,
termion::clear::AfterCursor, termion::clear::AfterCursor,
) )
.ok(); .ok();
write!(animation, "{}", termion::cursor::Restore).ok();
*cursor += 1; *cursor += 1;
*cursor %= DEFAULT_STYLE.len(); *cursor %= DEFAULT_STYLE.len();
} }