AMythicDev / minus

An asynchronous, runtime data feedable terminal paging library for Rust
https://crates.io/crates/minus/
Apache License 2.0
321 stars 23 forks source link

Minus does not seem to work on macOS #15

Closed pemistahl closed 3 years ago

pemistahl commented 3 years ago

Hello,

I've been looking for a terminal paging library for Rust and have come across Minus. I've tried to run the examples in both zsh and bash on macOS. However, when I do this:

cargo run --example=static --features=static_output

I always get this error:

Error: Paging(Setup(InvalidTerminal))

Is macOS not supported yet? If not, what's the problem here? Thanks.

AMythicDev commented 3 years ago

The problem is that, it checks if the stdout is a TTY and returns an error and if it is not, it works fine. But in reality it should be the inverse. I have fixed it, but hadn't pushed the changes. Pushing it now

AMythicDev commented 3 years ago

Could you confirm that it works. Although, I recommend you to use one of the good versions as I am currently working on some breaking changes (although it's ready but the new docs are not)

pemistahl commented 3 years ago

Thanks for your quick response, Arijit.

I've just found out that this error occurs in the current master branch only. Version 1.0.0 runs fine in my terminal, however, version 1.0.1 produces a new bug:

error[E0425]: cannot find value `mutex` in this scope
  --> src/static_pager.rs:96:26
   |
96 |                     draw(mutex.lock().unwrap().clone(), rows, &mut upper_mark)
   |                          ^^^^^ not found in this scope

But I can confirm that the new state on the master branch works as expected. I'm going to stick with version 1.0.0 for now and hope that it will work on all operating systems. Perhaps you can provide a bug fix release 1.0.2 soon which fixes the bug above in 1.0.1. Thank you.

AMythicDev commented 3 years ago

1.0.2 is already published in crates.io. Could you check if that works for you

pemistahl commented 3 years ago

I've found 1.0.3 to be the latest version on crates.io. That one works for me. It would be useful if you created Git tags for each release so that releases on both GitHub and crates.io are in sync. That would make it easier to keep track.

Thanks for your help.