Macchina-CLI / macchina

A system information frontend with an emphasis on performance.
https://crates.io/crates/macchina
MIT License
1.46k stars 51 forks source link

Macchina does not work without /dev/stdin on macOS #328

Open pallxk opened 1 month ago

pallxk commented 1 month ago

Describe the bug Macchina does not work without /dev/stdin on macOS. I've also tested on Arch Linux x86_64 and Arch Linux aarch64, they both work without /dev/stdin.

To Reproduce Steps to reproduce the behavior:

  1. macchina < /dev/null

Expected behavior Macchina runs correctly.

Actual behavior It hangs and cannot exit with CTRL-C.

Usage Scenario I put macchina into my .bashrc script, and would like it to not consume /dev/stdin, so that

Screenshots

image

macchina --doctor output

We've collected a total of 20 readouts including 2 failed read(s) and 1 read(s) resulting in a warning.

Readout "LocalIP" failed with message: Unable to get local IPv4 address.
Readout "GPU" failed with message: This metric is not available on this platform or is not yet implemented by libmacchina.

1 of the 3 unsuccessful read(s) resulted in a warning:
 Readout "Distribution" threw a warning with message: Since you're on macOS, there is no distribution to be read from the system.

System Information

I've also tested with macchina 6.1.8, it's the same issue for me.

pallxk commented 1 month ago

Some more findings on this:

Now it seems like a crossterm bug...

pallxk commented 1 month ago

Related crossterm bug at https://github.com/crossterm-rs/crossterm/issues/828

Workaround for macchina users on macOS:

macchina < /dev/null > >(cat)
grtcdr commented 1 month ago

Thanks for sharing that workaround, we'll upgrade to a non-affected version of crossterm when that issue is eventually addressed.