Bumps sysinfo to use the newest (breaking) version, 0.40.3. See https://github.com/GuillaumeGomez/sysinfo/blob/main/CHANGELOG.md#0403.
Note I'm not touching the new GPU API here for now. I'm not sure what I'll do on the Linux side as well since I have some fairly tailor-made integrations already, though for other platforms I'll take a look for sure.
Some events weren't blocked when dialog boxes were open, which would mean they would still do stuff behind the dialog (e.g. process actions). This change just blocks it from doing that if the dialog box is open.
Slightly complicated but basically, add some overriding behaviour based on the available width on what string to emit. The main idea is that if we can't fit the percentage sign, we'll first omit that. If it's in decimal mode and we can't fit the decimals too, we then omit the decimals. Finally, if we can't fit the whole number portion, return `None` to hide the column entirely.
Older Windows versions (8.1 and older) were failing to render properly due to winapi not supporting underlining.
Looks like we were transitively enabling this feature because of the crossterm feature, which pulls in ratatui_crossterm which enables it by default. As a quick fix, we manually pull in ratatui_crossterm ourselves and disable that feature.
This change makes it so that if bracketed paste is not supported (e.g. Windows 7/8), we proceed and don't outright panic. This also has some small cosmetic changes around execute! and cleanup.
https://github.com/rust-lang/rust-clippy/pull/17681 got merged a while ago - this makes it so the `regex_creation_in_loops` clippy `expect` "fails", since it is actually now not triggered.
Unfortunately, this is only in beta from the looks of it at the moment, so I can't just remove it entirely. This change just makes it an unconditional `allow` with a note to get rid of it at some point once it's stable.
Note this only affects macOS, where we use this. This was fine because it's only actually triggered once, and then cached via a `OnceLock`.
The way we're doing this for now is:
- If it's less than 100, always show 2 decimal places unless it ends in 0; if so, trim it away
- If it's less than 1000, then do the same but with 1
- If it's over 1000, show no decimal places.
Enable binary disk capacity units with:
```toml
[disk]
use_binary_prefix = true
```
Or pass `--disk_use_binary_prefix` (alias `--disk-use-binary-prefix`). The CLI flag takes precedence over a false config setting. Decimal units remain the default.
Used, Free, and Total use the existing binary conversion helper. For example, 536,870,912,000 bytes changes from `537GB` to `500GiB`. Percentages, sorting by raw byte values, I/O rates, and network units retain their existing behavior.
The change passes the option from argument/config parsing through application settings and collected disk data to cell formatting. Four regression tests cover option precedence and both CLI spellings, collection-to-cell wiring, unit boundaries, missing values, percentages, I/O behavior, and sorting.
This adds very basic GPU support for getting process usage for Intel GPUs on Linux. Note this PR does not handle memory/VRAM usage for now. The implementation is basically a clone of the AMD GPU one.
Doing this as refactoring work before I start working on supporting Intel GPUs, which are expected to share the same collection code. This should have no functional change.
This PR makes it so that we should hopefully avoid waking up NVIDIA GPUs while gathering info (on Linux only). It mostly follows how we were doing it for AMD devices, which required a bit of refactoring to get it to work with the NVML library I was using.
Note that, as mentioned above, it does not change behaviour for Windows (or other OSes that work with NVIDIA GPUs) at the moment, as I need to use some fairly OS-specific logic to get it to work on each platform from the looks of it.
Unfortunately, I no longer have any Nvidia-based machines to test with, let alone laptops with Optimus... so this may be hard to verify whether it works on my end.
This adds the ability to run with `--network_start_zeroed` or the `start_zeroed` config option, which will zero out the total network usage so that bottom starts with it at zero, rather than the total network usage reported by the OS since boot.
There was an if-condition that only ran if the sort state was false. But this would never be hit since `use_sort_table_value` always set it to false beforehand, so it would be stuck focusing on a hidden menu.
Wanted to prune Cargo.toml a tiny bit and noticed I could just use humantime to do this instead of time for logging purposes. Of course I still pull it in via Cargo.lock though.
A looooong time ago, we had to manually hijack stdio for FreeBSD to suppress a bogus stderr warning (see
#798). I filed an upstream report at GuillaumeGomez/sysinfo#875, but the real issue was actually with FreeBSD itself. From the upstream upstream bug report at https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=228432, it looks like this has been fixed since 2022 for FreeBSD 13, so I think it's safe to remove this hack at this point on our end, especially given that I don't build binaries for older than FreeBSD 13 anymore (oldest is 15 now).
This PR allows us to entirely remove the filedescriptor crate for FreeBSD since we no longer use it entirely.
I made the assumption that the max length of the comm field is 16 bytes. This is wrong though - it's now 64.
Note we may want to change it in the future to work regardless of potential length.
Because of the way I was initializing things, this caused it to report a huge spike at the start since it was doing a subtraction against 0. This fixes it by just using a hashmap (which also fixed another FIXME) and initializing the prev comparison structure on first view + skipping the first instance.
The bug would cause something like `(sd-pam)` to be missing, because what would happen is this:
1. We have something like `"123 ((sd-pam)) blah blah blah"`
2. We parse `start_paren` to be index 5.
3. We parse `end_paren` to be index 13.
4. Our `comm` is `"(sd-pam"`, and the rest of our string is `") blah blah blah"`... which is problematic, as then the rest of the parsing will be incorrect, and the entry gets rejected!
Deals with a possible issue with kitty and its `cursor_trail` functionality, where it supposedly does a bit of extra calculation work when the cursor's location after drawing is too far from the previous location when kitty is checking whether it should recalculate things for the trail, even if the cursor is hidden (at least this is my guess by looking around in https://github.com/kovidgoyal/kitty/blob/c1d507dbe8cd12830d8b97b0d350d9dc2e4d383f/kitty/cursor_trail.c). The fix is (apparently) to just park the cursor at the origin after drawing each time, and this seemingly helps as a workaround.
If this is right (and it very well could be wrong, I'm making a guess here), IMO the actual fix is that kitty should _probably_ skip cursor trail calculation work if the cursor is hidden I guess?