Commit Graph
1141 Commits
Author SHA1 Message Date
ClementTsang b539dafd59 Revert "deps: bump sysinfo to 0.40.3 (#2314)"
This reverts commit 3843f17467.
2026-11-12 18:55:24 -05:00
Clement Tsang 3843f17467 deps: bump sysinfo to 0.40.3 (#2314)
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.
2026-11-12 06:45:05 +00:00
Max Coplan 7873001024 feature: add wrapped process command viewer (#2263)
Currently, long command names are cut off with no way to view the full command. This commit allows pressing `w` to show the full command.
2026-11-11 03:51:33 -05:00
Clement Tsang 0410a176e8 other: run nightly format (#2307)
Runs nightly format as of 2026-11-09.
2026-11-09 02:53:38 -05:00
Daniel JB Clark fd8cc7d6ca bug: fix hidden columns shifting widths and header clicks (#2298) 2026-11-02 21:32:52 -05:00
Clement Tsang 540bb71a35 bug: fix dialogs not blocking certain events (#2300)
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.
2026-11-02 16:58:10 +00:00
Clement Tsang ae884b110b other: add mimalloc allocator for possible use for musl (#2299)
This adds the mimalloc allocator as an optional musl feature; note that this is still disabled by default.
2026-11-02 16:14:04 +00:00
Clement Tsang 3d5ff66726 change: better truncate CPU usage strings with small widths (#2296)
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.
2026-11-02 04:08:34 +00:00
Clement Tsang 1772396845 fix: disable crossterm ratatui underline feature for older Windows compatibility (#2293)
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.
2026-10-31 01:16:51 +08:00
Clement Tsang fdc61cafd6 bug: make it so bracketed paste not working does not panic (#2284)
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.
2026-10-28 08:04:10 +08:00
NavpreetSSidhu b48e807055 bug: don't abort in panic hook if the terminal is gone (#2279) 2026-10-27 14:05:48 -04:00
Clement Tsang 03dd52bfe5 deps: bump starship-battery to 0.12.0 (#2272)
Bumps starship-battery to the newest 0.12.0 version. A small amount of code change was needed due to the new Paused state.

Changelog: https://github.com/starship/rust-battery/blob/main/CHANGELOG.md#0120---2026-09-27
2026-09-30 05:31:39 -04:00
Clement Tsang 048deff943 other: allow clippy lint for regex creation in loops (#2270)
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`.
2026-09-29 05:13:21 +00:00
Clement Tsang 5ad904068d change: show decimal places for disk usage info (#2266)
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.
2026-09-28 07:34:01 +00:00
Clement Tsang fdc298716e bug: fix scrollbar not drawing if the height was 2 or less (#2261) 2026-09-22 00:56:15 -04:00
Clement Tsang eb9c47d8d4 other: make scrollbar enabled by default (#2260) 2026-09-22 00:56:14 -04:00
Abu Hurayra Niloy 4136d204bc feature: add process swap column for Linux (#2224)
Adds Linux support for process swap tracking + a column in the widget.
2026-09-21 17:22:46 -04:00
Clement Tsang d7b56f6ab7 feature: support binary prefix option for disk table I/O (#2251)
This is a follow-up to
https://github.com/ClementTsang/bottom/pull/2236#issuecomment-5689665534 so the binary prefix configuration also affects the disk I/O display. Note this does not touch the graph at the moment, just the table.
2026-09-16 00:05:49 -04:00
Peder Bergan c10a2adbd4 feat: add configurable binary disk capacity units (#2236)
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.
2026-09-15 20:47:06 -04:00
Clement Tsang 875e892687 feature: add more pipe gauge bar fill options (#2245)
Adds block and square character options for pipe gauge widgets.

May still redesign this (maybe add option for a background), but this is fine for now.
2026-09-12 16:28:29 -04:00
Clement Tsang 861791698e feature: initial Intel GPU support to get process usage (#2239)
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.
2026-09-07 00:11:05 -04:00
Clement Tsang fe79718e17 refactor: move GPU collection files around (#2231)
No functionality change, this just rearranges the file structure a bit.
2026-09-04 02:00:38 -04:00
Clement Tsang f9e1703727 Improve linux nvidia gpu caching (#2230)
Changes it from a 10s full cache to a 60s conditional cache; we still check the power state now even when using the cached list.
2026-09-03 03:18:51 -04:00
Clement Tsang 30fb02c187 refactor: move Linux DRM-related collection code into its own file (#2228)
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.
2026-09-02 02:48:18 -04:00
Clement Tsang e4ba8c657b refactor: run nightly format (#2229)
Run nightly format as of 2026-08-31.
2026-09-01 10:02:00 +00:00
Clement Tsang 175c12edc4 bug: don't check sleeping NVIDIA GPU/devices to avoid waking them on Linux (#2225)
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.
2026-08-31 07:09:41 +00:00
fazzi 4be359f9ff bug: handle Linux cmdline that don't have null byte separators (#2210) 2026-08-25 03:09:06 -04:00
Anis e7ec56333b docs: fix typo in the '--help' flag (#2207) 2026-08-24 01:06:17 -04:00
Clement Tsang 0b22ee4c43 feature: add option to show zeroed total network usage on startup (#2199)
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.
2026-08-17 00:12:21 -04:00
Clement Tsang a10eadd2d5 bug: fix cgroups v1 swap collection around sentinel max value (#2195)
Problem was that with cgroups v1, if the swap had an unlimited value set, it would be done by just setting a huge integer, which would break things.
2026-08-13 05:22:40 -04:00
Clement Tsang 726f787b89 bug: fix close logic when pressing enter in sort menu (#2191)
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.
2026-08-13 00:40:41 +00:00
Clement Tsang 836ec5bf7f deps: don't directly use time for logging (#2182)
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.
2026-07-31 09:14:48 +00:00
Clement Tsang 95b60c8016 feature: add configurable default column sort order (#2174)
Adds an optional configuration field for the temp/process/disk table widgets to control the default sort order.
2026-07-26 20:37:20 -04:00
Clement Tsang 547011a5c4 other: remove filedescriptor hack for freebsd (#2167)
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.
2026-07-20 03:29:18 -04:00
Clement Tsang e68dd616de other: remove rfind optimization for linux process stat parsing (#2164)
We're removing this micro-optimization in favour of not potentially breaking against the unstable ABI for process lengths. Sucks but oh well.
2026-07-20 01:03:02 +00:00
Clement Tsang 204c1edf9b bug: fix incorrect bound length for comm parentheses searching (#2163)
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.
2026-07-19 23:30:19 +00:00
Clement Tsang b9b1a203c8 bug: fix incorrect header text being used for the process widget (#2162)
This was causing us to not show the correct header (e.g. one with shortcuts) for the process widget.
2026-07-19 22:21:51 +00:00
Clement Tsang 8b2b3327b3 bug: fix first disk I/O value reported at startup being incorrect (#2152)
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.
2026-07-15 08:11:49 +00:00
Clement Tsang d0053421b4 bug: fix missing deserialize options for read/write in process widget (#2150)
Fix us not accepting `read/rps` and `write/wps` as columns. This also adds tests to catch this more easily in the future.
2026-07-15 06:43:14 +00:00
Clement Tsang ddbb8aae99 refactor: use add impl for adding memory values in the neum (#2148) 2026-07-14 00:08:05 -04:00
Clement Tsang 9c79622422 bug: fix draw bug where the pipe chars could draw over the end (#2146)
Technically the end could draw over since I did `start..pipe_end`, where `pipe_end` could be equal to `end`. This just caps it at `end - 1`.
2026-07-13 00:04:31 -04:00
Clement Tsang c696597e81 bug: fix parsing issue certain comm entries to be missing (#2145)
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!
2026-07-12 00:13:49 -04:00
Clement Tsang 69f6ce1553 bug: fix bug with Linux signals 34 or higher being off by 2 (#2144)
Fixes a bug with determining the signal for Linux since there was a logic bug. Oops.
2026-07-11 00:39:10 -04:00
Clement Tsang 892157794a other: fix a potential underflow with ARC memory subtraction (#2143) 2026-07-11 00:01:36 -04:00
Clement Tsang 6d55442c0c bug: actually fix capitalized 'q' not exiting (#2137)
Turns out it needs to be done through the shift branch. Oops. Also updates docs.
2026-07-09 05:06:53 -04:00
Umberto Puddu bebc199a3c bug: accept process column aliases advertised by the config schema (#2131) 2026-07-07 22:34:01 -04:00
Clement Tsang 9fc30ac2ff refactor: small cleanup of some string formatting (#2130)
Some quick random refactors I spotted while looking at something else.
2026-07-07 04:34:08 -04:00
Clement Tsang af18a747e9 other: attempt a fix to reduce CPU cycles spent on kitty for cursor_trail (#2119)
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?
2026-06-30 21:59:48 +00:00
Clement Tsang 0666032052 other: remove extra show that does nothing (#2117) 2026-06-29 23:05:00 -04:00
Clement Tsang 1a0d99b2b4 other: remove extra hide/show that does nothing (#2116)
Spotted while looking into something else, we call it twice (once right after). These should be safe to remove as such.
2026-06-30 02:27:53 +00:00