Skip to content

Commit

Permalink
remote: "Fix" spinner on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
scizzorz committed Jul 21, 2020
1 parent 255a023 commit 31a7e56
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ fn with_spinner<F>(label: String, f: F) -> Result<(), Error>
where
F: FnOnce() -> Result<(), Error>,
{
if atty::is(atty::Stream::Stdout) {
// spinners don't work on Windows or without a TTY
if atty::is(atty::Stream::Stdout) && std::env::consts::FAMILY != "windows" {
let spinner = Spinner::new(Spinners::Dots, label);
let res = f();
// finish spinner
spinner.stop();
println!();
res
} else {
// without a spinner, just print the line.
println!("{}", label);
f()
}
Expand Down

0 comments on commit 31a7e56

Please sign in to comment.