Skip to content

Commit

Permalink
Merge pull request #146 from xtfc/dev-144
Browse files Browse the repository at this point in the history
remote: "Fix" spinner on Windows
  • Loading branch information
scizzorz authored Jul 21, 2020
2 parents 255a023 + 31a7e56 commit 7a4dbca
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 7a4dbca

Please sign in to comment.