Commit Graph

200 Commits

Author SHA1 Message Date
Steffen Winter
fd9cd479ad refactor: use fmt::format like interface for logger
This will only allocate the log message if a log file exists and the log
level is enabled. The interface forwards it's arguments to fmt::format.
This gets also rid of some global state and hides it in the btop_log.cpp
translation unit.

Closes: https://github.com/aristocratos/btop/issues/1347
2026-01-04 12:11:21 +01:00
aristocratos
975e3951da v1.4.6 New features & Bug fixes 2025-12-26 16:53:24 +01:00
aristocratos
e969f43a41 Added "save_config_on_exit" option to configuration. 2025-12-26 16:35:37 +01:00
Jakob P. Liljenberg
0d08551b41 Merge pull request #1357 from adeci/themes-dir 2025-12-02 22:15:13 +01:00
Yinghao
d4eb16f5d1 fix: respect cpu_graph_lower = "Auto" (#1379)
Sometimes GPU data wasn't collected the cpu_graph_lower option was set to "Auto".

Closes: https://github.com/aristocratos/btop/issues/1368
Co-authored-by: Steffen Winter <steffen.winter@proton.me>
2025-11-26 20:44:58 +00:00
Santhosh Raju
f88ecb7757 Help btop find its themes in NetBSD. 2025-11-22 13:42:34 +01:00
adeci
04c3a938a8 feat: add --themes-dir flag 2025-11-10 10:04:49 +07:00
Steffen Winter
520a4bd611 test: add test harness with ctest 2025-11-02 17:16:56 +01:00
aristocratos
6847a44c26 Add missed conditionals for terminal sync toggle 2025-10-26 19:55:30 +01:00
aristocratos
d0cbaf772d Add configuration toggle for terminal synchronization 2025-10-26 19:44:04 +01:00
Steffen Winter
a22eaf314a refactor: use std::string::contains 2025-10-26 16:18:20 +01:00
Steffen Winter
064aeb9de2 refactor: use std::expected to indicate failure 2025-10-26 13:24:57 +01:00
kuzmeech
8f2d9cf292 Fix thread restart race condition causing deadlocks
Add pthread_join() after pthread_cancel() to wait for thread termination
before creating a new one. This prevents the race condition where multiple
runner threads could accumulate and deadlock.
2025-10-12 13:48:28 -04:00
kuzmeech
9fb085afc3 Add crash handlers to restore terminal state
Install signal handlers for SIGSEGV, SIGABRT, SIGTRAP, SIGBUS, and SIGILL
to restore terminal state before crashing. This prevents leaving the terminal
in a broken state if btop crashes unexpectedly.
2025-10-12 13:48:28 -04:00
aristocratos
a1099d075f v1.4.5 Bug fixes 2025-09-19 22:29:22 +02:00
aristocratos
4f5abbb3eb Revert unnecessary locale changes and remove debug line. 2025-08-11 14:45:26 +02:00
aristocratos
86ec5fd062 Changed decimal points to always be dots regardless of locale, issue #1183 2025-07-18 00:20:18 +02:00
Steffen Winter
b3356354a4 Fix --tty/--no-tty flag having no effect
Use the right config key for the tty setting, which is `tty_mode` and not
`force_tty`.

Rewrite the code to evaluate whether to force tty mode or not, which
wasn't respecting the command line flags correctly.

Closes: https://github.com/aristocratos/btop/issues/1190
2025-07-16 16:42:04 +00:00
aristocratos
0f398abd64 v1.4.4 Bug fixes 2025-07-03 22:53:42 +02:00
Steffen Winter
1b0b89212e Add command line option to set an inital filter
This will spawn btop with a filter already set, which can be edited and
also deleted as usual.

Beware that the filter will ALWAYS also match btop itself, since the
--filter argument on the command line will match.

Closes: https://github.com/aristocratos/btop/issues/883
2025-06-07 13:02:15 +00:00
aristocratos
3f1ccd9f6c v1.4.3 Bug fixes 2025-05-10 13:02:34 +02:00
aristocratos
274d0c78e5 v1.4.2 Bug fixes 2025-05-01 22:24:11 +02:00
Steffen Winter
99713316e8 perf: avoid copies with capture-by-reference 2025-05-01 20:36:27 +02:00
Tom Webber
a5b01c1ac3 Fix wrong naming in documentation and error messages for force-utf argument 2025-05-01 17:47:30 +00:00
Steffen Winter
d3e16cb8e3 Respect the cli flags debug and force utf
This was missed in de0d295f6f.
2025-05-01 17:47:30 +00:00
Steffen Winter
70223c8c1c Remove unused variable 2025-05-01 17:47:30 +00:00
aristocratos
666d31b1ab v1.4.1 2025-04-27 15:52:29 +02:00
d40cd430b8 Mark destructor noexcept and satisfy rule-of-five
Follow the RAII paradigm and define all 5 special class function if any
of them has a non-default implementation. Avoids duplicate destruction
or other unwanted effects.
2025-04-24 19:04:02 +00:00
81cdf9d7c4 Initialize all struct fields
Avoid uninitialized members.
2025-04-24 19:04:02 +00:00
4c4a161421 Use explicit single parameter constructor
Avoid implicit conversions; these might be unwanted or truncating.
2025-04-24 19:04:02 +00:00
48a1fbe3a7 Declare local function static
Clarifies the intended scope of the functions.
2025-04-24 19:04:02 +00:00
e0914771cd Add missing override annotations
Help the compiler in finding mismatches.
2025-04-24 19:04:02 +00:00
bdec3d653f Avoid comma operator
Simply split the expressions.
2025-04-24 19:04:02 +00:00
Steffen Winter
de0d295f6f Move the config parser in it's own module
Return a struct with options instead of settings globals.
2025-04-23 16:48:02 +00:00
Steffen Winter
b21b1daa84 Drop workarounds for GCC 10
GCC 10 and even 11 don't receive updates anymore.

Using Debian stable as the baseline (as done previously), most major
distributions have a recent enought toolchain with GCC 11 or later. The
same applies for LLVM.

Signed-off-by: Steffen Winter <steffen.winter@proton.me>
2025-04-19 15:09:58 +00:00
Steffen Winter
4df81010a7 Make arg parser function to snake_case
Signed-off-by: Steffen Winter <steffen.winter@proton.me>
2025-04-19 12:26:30 +00:00
Steffen Winter
161c53b978 Combine help function calls in argument parser
Signed-off-by: Steffen Winter <steffen.winter@proton.me>
2025-04-19 12:26:30 +00:00
Steffen Winter
e6dc808cee Add CLI flag to specify a different config file
Signed-off-by: Steffen Winter <steffen.winter@proton.me>
2025-04-19 12:26:30 +00:00
Steffen Winter
5f9147d55b Use XDG_STATE_HOME to save logs
Closes: #1019

Signed-off-by: Steffen Winter <steffen.winter@proton.me>
2025-04-16 13:32:29 +00:00
aristocratos
6c0cedd891 v1.4.0 Intel GPU support & NetBSD support 2024-09-22 12:48:38 +02:00
aristocratos
161e8f4481 Added warnings when toggling boxes and terminal size is to small 2024-09-22 00:28:30 +02:00
Jakob P. Liljenberg
8cc640a033 Merge branch 'main' into command-line-output 2024-08-04 15:44:02 +02:00
Steffen Winter
f6c1166486 Beautify command line error output and help message 2024-07-18 13:23:14 +02:00
Santhosh Raju
d096dbebe1 Add NetBSD Support. 2024-06-29 02:01:37 +02:00
Otto Kekäläinen
bfe8c20ebe Fix misc spelling 2024-02-29 22:11:39 -08:00
Jakob P. Liljenberg
967ea1ab6f Merge branch 'main' into build-info 2024-02-18 14:19:05 +01:00
aristocratos
fd2a2acdad v1.3.2 Hotfix GPU support AMD ROCm v6 2024-02-12 16:30:09 +01:00
aristocratos
9c34ac75dc v1.3.1 Bug fixes 2024-02-11 18:32:27 +01:00
Jakob P. Liljenberg
283ad3e76e Merge branch 'main' into utf8-ctype 2024-02-11 17:49:35 +01:00
aristocratos
1670e1db79 Reuse code from init, properly log warnings and move execution in to main loop 2024-02-11 17:42:51 +01:00