Coder Social home page Coder Social logo

btop's Introduction

btop++

Packaging status

Linux macOS FreeBSD OpenBSD Usage c++20 latest_release Donate Sponsor Coffee btop Continuous Build Linux Continuous Build macOS Continuous Build FreeBSD Continuous Build OpenBSD

Index

News

7 January 2024

Btop release v1.3.0

Big release with GPU support added for Linux and platform support for OpenBSD. Big thanks to @romner-set (GPU support) and @joske (OpenBSD support) for contributions. And a multitude of bugfixes and small changes, see CHANGELOG.md and latest release for detailed list and attributions.

See news entry below for more information regarding GPU support.

25 November 2023

GPU monitoring added for Linux!

Compile from git main to try it out.

Use keys 5, 6, 7 and 0 to show/hide the gpu monitoring boxes. 5 = Gpu 1, 6 = Gpu 2, etc.

Gpu stats/graphs can also be displayed in the "Cpu box" (not as verbose), see the cpu options menu for info and configuration.

Note that the binaries provided on the release page (when released) and the continuous builds will not have gpu support enabled.

Because the GPU support relies on loading of dynamic gpu libraries, gpu support will not work when also static linking.

See Compilation Linux for more info on how to compile with gpu monitoring support.

Many thanks to @romner-set who wrote the vast majority of the implementation for GPU support.

Big update with version bump to 1.3 coming soon.

28 August 2022

btop4win

First release of btop4win available at https://github.com/aristocratos/btop4win

More...
16 January 2022

Release v1.2.0 with FreeBSD support. No release binaries for FreeBSD provided as of yet.

Again a big thanks to @joske for his porting efforts!

Since compatibility with Linux, macOS and FreeBSD are done, the focus going forward will be on new features like GPU monitoring.

13 November 2021

Release v1.1.0 with macOS support. Binaries in continuous-build-macos are only x86 for now. macOS binaries + installer are included for both x86 and ARM64 (Apple Silicon) in the releases.

Big thank you to @joske who wrote the vast majority of the implementation!

30 October 2021

Work on the OSX [macOS] and FreeBSD branches, both initiated and mostly worked on by @joske, will likely be completed in the coming weeks. The OSX [macOS] branch has some memory leaks that needs to be sorted out and both have some issues with the processes cpu usage calculation and other smaller issues that needs fixing.

If you want to help out, test for bugs/fix bugs or just try out the branches:

macOS / OSX

# Install and use Homebrew or MacPorts package managers for easy dependency installation
brew install coreutils make gcc@11 lowdown
git clone https://github.com/aristocratos/btop.git
cd btop
git checkout OSX
gmake

FreeBSD

sudo pkg install gmake gcc11 coreutils git lowdown
git clone https://github.com/aristocratos/btop.git
cd btop
git checkout freebsd
gmake

Note that GNU make (gmake) is recommended but not required for macOS/OSX but it is required on FreeBSD.

6 October 2021

macOS development have been started by @joske, big thanks :) See branch OSX for current progress.

18 September 2021

The Linux version of btop++ is complete. Released as version 1.0.0

I will be providing statically compiled binaries for a range of architectures in every release for those having problems compiling.

For compilation GCC 10 is required, GCC 11 preferred.

Please report any bugs to the Issues page.

The development plan right now:

  • 1.1.0 macOS [OSX] support
  • 1.2.0 FreeBSD support
  • 1.3.0 Support for GPU monitoring
  • 1.X.0 Other platforms and features...

Windows support is not in the plans as of now, but if anyone else wants to take it on, I will try to help.

5 May 2021

This project is gonna take some time until it has complete feature parity with bpytop, since all system information gathering will have to be written from scratch without any external libraries. And will need some help in the form of code contributions to get complete support for BSD and macOS/OSX.

Documents

CHANGELOG.md

CONTRIBUTING.md

CODE_OF_CONDUCT.md

Description

Resource monitor that shows usage and stats for processor, memory, disks, network and processes.

C++ version and continuation of bashtop and bpytop.

Features

  • Easy to use, with a game inspired menu system.
  • Full mouse support, all buttons with a highlighted key is clickable and mouse scroll works in process list and menu boxes.
  • Fast and responsive UI with UP, DOWN keys process selection.
  • Function for showing detailed stats for selected process.
  • Ability to filter processes.
  • Easy switching between sorting options.
  • Tree view of processes.
  • Send any signal to selected process.
  • UI menu for changing all config file options.
  • Auto scaling graph for network usage.
  • Shows IO activity and speeds for disks.
  • Battery meter
  • Selectable symbols for the graphs.
  • Custom presets
  • And more...

Themes

Btop++ uses the same theme files as bpytop and bashtop (some color values missing in bashtop themes) .

See themes folder for available themes.

The make install command places the default themes in [$PREFIX or /usr/local]/share/btop/themes. User created themes should be placed in $XDG_CONFIG_HOME/btop/themes or $HOME/.config/btop/themes.

Let me know if you want to contribute with new themes.

Support and funding

You can sponsor this project through github, see my sponsors page for options.

Or donate through paypal or ko-fi.

Any support is greatly appreciated!

Prerequisites

For best experience, a terminal with support for:

  • 24-bit truecolor (See list of terminals with truecolor support)
  • 256-color terminals are supported through 24-bit to 256-color conversion when setting "truecolor" to False in the options or with "-lc/--low-color" arguments.
  • 16 color TTY mode will be activated if a real tty device is detected. Can be forced with "-t/--tty_on" arguments.
  • Wide characters (Are sometimes problematic in web-based terminals)

Also needs a UTF8 locale and a font that covers:

  • Unicode Block “Braille Patterns” U+2800 - U+28FF (Not needed in TTY mode or with graphs set to type: block or tty.)
  • Unicode Block “Geometric Shapes” U+25A0 - U+25FF
  • Unicode Block "Box Drawing" and "Block Elements" U+2500 - U+259F

Optional Dependencies (Needed for GPU monitoring)

GPU monitoring also requires a btop binary built with GPU support (GPU_SUPPORT=true flag).

See GPU compatibility section for more about compiling with GPU support.

  • NVIDIA

If you have an NVIDIA GPU you must use an official NVIDIA driver, both the closed-source and open-source ones have been verified to work.

In addition to that you must also have the nvidia-ml dynamic library installed, which should be included with the driver package of your distribution.

  • AMD

If you have an AMD GPU rocm_smi_lib is required, which may or may not be packaged for your distribution.

Notice (Text rendering issues)

  • If you are having problems with the characters in the graphs not looking like they do in the screenshots, it's likely a problem with your systems configured fallback font not having support for braille characters.

  • See Terminess Powerline for an example of a font that includes the braille symbols.

  • See comments by @sgleizes link and @XenHat link in issue #100 for possible solutions.

  • If text are misaligned and you are using Konsole or Yakuake, turning off "Bi-Directional text rendering" is a possible fix.

  • Characters clipping in to each other or text/border misalignments is not bugs caused by btop, but most likely a fontconfig or terminal problem where the braille characters making up the graphs aren't rendered correctly.

  • Look to the creators of the terminal emulator you use to fix these issues if the previous mentioned fixes don't work for you.

Screenshots

Main UI showing details for a selected process

Screenshot 1

Main UI in TTY mode

Screenshot 2

Main UI with custom options

Screenshot 3

Main-menu

Screenshot 3

Options-menu

Screenshot 4

Help-menu

Screenshot 5

Installation

Binaries for Linux are statically compiled with musl and works on kernel 2.6.39 and newer

  1. Download btop-(VERSION)-(ARCH)-(PLATFORM).tbz from latest release and unpack to a new folder

    Notice! Use x86_64 for 64-bit x86 systems, i486 and i686 are 32-bit!

  2. Install (from created folder)

    • Run install.sh or:
    # use "make install PREFIX=/target/dir" to set target, default: /usr/local
    # only use "sudo" when installing to a NON user owned directory
    sudo make install
  3. (Optional) Set suid bit to make btop always run as root (or other user)

    Enables signal sending to any process without starting with sudo and can prevent /proc read permissions problems on some systems.

    • Run setuid.sh or:
    # run after make install and use same PREFIX if any was used at install
    # set SU_USER and SU_GROUP to select user and group, default is root:root
    sudo make setuid
  • Uninstall

    • Run uninstall.sh or:
    sudo make uninstall
  • Show help

    make help

Binary release (from native os repo)

  • openSUSE
  • Fedora
    sudo dnf install btop
  • RHEL/AlmaLinux 8+
    sudo dnf install epel-release
    sudo dnf install btop
  • FreeBSD
     pkg install btop

Binary release on Homebrew (macOS (x86_64 & ARM64) / Linux (x86_64))

Compilation Linux

Requires at least GCC 10 or Clang 16.

The makefile also needs GNU coreutils and sed (should already be installed on any modern distribution).

GPU compatibility

Btop++ supports NVIDIA and AMD GPUs out of the box on Linux x86_64, provided you have the correct drivers and libraries.

Compatibility with Intel GPUs using generic DRM calls is planned, as is compatibility for FreeBSD and macOS.

Gpu support will not work when static linking glibc (or musl, etc.)!

For x86_64 Linux the flag GPU_SUPPORT is automatically set to true, to manually disable gpu support set the flag to false, like:

make GPU_SUPPORT=false (or cmake -DBTOP_GPU=false with CMake)

  • NVIDIA

    You must use an official NVIDIA driver, both the closed-source and open-source ones have been verified to work.

    In addition to that you must also have the nvidia-ml dynamic library installed, which should be included with the driver package of your distribution.

  • AMD

    AMDGPU data is queried using the ROCm SMI library, which may or may not be packaged for your distribution. If your distribution doesn't provide a package, btop++ is statically linked to ROCm SMI with the RSMI_STATIC=true make flag.

    This flag expects the ROCm SMI source code in lib/rocm_smi_lib, and compilation will fail if it's not there. The latest tested version is 5.6.x, which can be obtained with the following command:

    git clone https://github.com/rocm/rocm_smi_lib.git --depth 1 -b rocm-5.6.x lib/rocm_smi_lib

With Make

  1. Install dependencies (example for Ubuntu 21.04 Hirsute)

    sudo apt install coreutils sed git build-essential gcc-11 g++-11 lowdown
  2. Clone repository

    git clone https://github.com/aristocratos/btop.git
    cd btop
  3. Compile

    make

    Options for make:

    Flag Description
    VERBOSE=true To display full compiler/linker commands
    STATIC=true For static compilation
    QUIET=true For less verbose output
    STRIP=true To force stripping of debug symbols (adds -s linker flag)
    DEBUG=true Sets OPTFLAGS to -O0 -g and enables more verbose debug logging
    ARCH=<architecture> To manually set the target architecture
    FORTIFY_SOURCE=false Disable fortification with _FORTIFY_SOURCE=3
    GPU_SUPPORT=<true|false> Enable/disable GPU support (Enabled by default on X86_64 Linux)
    RSMI_STATIC=true To statically link the ROCm SMI library used for querying AMDGPU
    ADDFLAGS=<flags> For appending flags to both compiler and linker
    CXX=<compiler> Manually set which compiler to use

    Example: make ADDFLAGS=-march=native might give a performance boost if compiling only for your own system.

    Notice! If using LDAP Authentication, usernames will show as UID number for LDAP users if compiling statically with glibc.

  4. Install

    sudo make install

    Append PREFIX=/target/dir to set target, default: /usr/local

    Notice! Only use "sudo" when installing to a NON user owned directory.

  5. (Optional) Set suid bit to make btop always run as root (or other user)

    sudo make setuid

    No need for sudo to enable signal sending to any process and to prevent /proc read permissions problems on some systems.

    Run after make install and use same PREFIX if any was used at install.

    Set SU_USER and SU_GROUP to select user and group, default is root and root

  • Uninstall

    sudo make uninstall
  • Remove any object files from source dir

    make clean
  • Remove all object files, binaries and created directories in source dir

    make distclean
  • Show help

    make help

With CMake (Community maintained)

  1. Install build dependencies

    Requires Clang / GCC, CMake, Ninja, Lowdown and Git

    For example, with Debian Bookworm:

    sudo apt install cmake git g++ ninja-build lowdown
  2. Clone the repository

    git clone https://github.com/aristocratos/btop.git && cd btop
  3. Compile

    # Configure
    cmake -B build -G Ninja
    # Build
    cmake --build build

    This will automatically build a release version of btop.

    Some useful options to pass to the configure step:

    Configure flag Description
    -DBTOP_STATIC=<ON|OFF> Enables static linking (OFF by default)
    -DBTOP_LTO=<ON|OFF> Enables link time optimization (ON by default)
    -DBTOP_USE_MOLD=<ON|OFF> Use mold to link btop (OFF by default)
    -DBTOP_PEDANTIC=<ON|OFF> Compile with additional warnings (OFF by default)
    -DBTOP_WERROR=<ON|OFF> Compile with warnings as errors (OFF by default)
    -DBTOP_FORTIFY=<ON|OFF> Detect buffer overflows with _FORTIFY_SOURCE=3 (ON by default)
    -DBTOP_GPU=<ON|OFF> Enable GPU support (ON by default)
    -DBTOP_RSMI_STATIC=<ON|OFF> Build and link the ROCm SMI library statically (OFF by default)
    -DCMAKE_INSTALL_PREFIX=<path> The installation prefix ('/usr/local' by default)

    To force any other compiler, run CXX=<compiler> cmake -B build -G Ninja

  4. Install

    cmake --install build

    May require root privileges

  5. Uninstall

    CMake doesn't generate an uninstall target by default. To remove installed files, run

    cat build/install_manifest.txt | xargs rm -irv
    
  6. Cleanup build directory

    cmake --build build -t clean

Compilation macOS OSX

Requires at least GCC 10 or Clang 16.

With GCC, version 12 (or better) is needed for macOS Ventura. If you get linker errors on Ventura you'll need to upgrade your command line tools (Version 14.0) is bugged.

The makefile also needs GNU coreutils and sed.

Install and use Homebrew or MacPorts package managers for easy dependency installation

With Make

  1. Install dependencies (example for Homebrew)

    brew install coreutils make gcc@12 lowdown
  2. Clone repository

    git clone https://github.com/aristocratos/btop.git
    cd btop
  3. Compile

    gmake

    Options for make:

    Flag Description
    VERBOSE=true To display full compiler/linker commands
    STATIC=true For static compilation (only libgcc and libstdc++)
    QUIET=true For less verbose output
    STRIP=true To force stripping of debug symbols (adds -s linker flag)
    DEBUG=true Sets OPTFLAGS to -O0 -g and enables more verbose debug logging
    ARCH=<architecture> To manually set the target architecture
    FORTIFY_SOURCE=false Disable fortification with _FORTIFY_SOURCE=3
    ADDFLAGS=<flags> For appending flags to both compiler and linker
    CXX=<compiler> Manually set which compiler to use

    Example: gmake ADDFLAGS=-march=native might give a performance boost if compiling only for your own system.

  4. Install

    sudo gmake install

    Append PREFIX=/target/dir to set target, default: /usr/local

    Notice! Only use "sudo" when installing to a NON user owned directory.

  5. (Recommended) Set suid bit to make btop always run as root (or other user)

    sudo gmake setuid

    No need for sudo to see information for non user owned processes and to enable signal sending to any process.

    Run after make install and use same PREFIX if any was used at install.

    Set SU_USER and SU_GROUP to select user and group, default is root and wheel

  • Uninstall

    sudo gmake uninstall
  • Remove any object files from source dir

    gmake clean
  • Remove all object files, binaries and created directories in source dir

    gmake distclean
  • Show help

    gmake help

With CMake (Community maintained)

  1. Install build dependencies

    Requires Clang, CMake, Ninja, Lowdown and Git

    brew update --quiet
    brew install cmake git llvm ninja lowdown
  2. Clone the repository

    git clone https://github.com/aristocratos/btop.git && cd btop
  3. Compile

    # Configure
    export LLVM_PREFIX="$(brew --prefix llvm)"
    export CXX="$LLVM_PREFIX/bin/clang++"
    export CPPFLAGS="-I$LLVM_PREFIX/include"
    export LDFLAGS="-L$LLVM_PREFIX/lib -L$LLVM_PREFIX/lib/c++ -Wl,-rpath,$LLVM_PREFIX/lib/c++ -fuse-ld=$LLVM_PREFIX/bin/ld64.lld"
    cmake -B build -G Ninja
    # Build
    cmake --build build

    Note: btop uses lots of C++ 20 features, so it's necessary to be specific about the compiler and the standard library. If you get a compile with Apple-Clang or GCC, feel free to add the instructions here.

    This will automatically build a release version of btop.

    Some useful options to pass to the configure step:

    Configure flag Description
    -DBTOP_LTO=<ON|OFF> Enables link time optimization (ON by default)
    -DBTOP_USE_MOLD=<ON|OFF> Use mold to link btop (OFF by default)
    -DBTOP_PEDANTIC=<ON|OFF> Compile with additional warnings (OFF by default)
    -DBTOP_WERROR=<ON|OFF> Compile with warnings as errors (OFF by default)
    -DBTOP_FORTIFY=<ON|OFF> Detect buffer overflows with _FORTIFY_SOURCE=3 (ON by default)
    -DCMAKE_INSTALL_PREFIX=<path> The installation prefix ('/usr/local' by default)

    To force any specific compiler, run CXX=<compiler> cmake -B build -G Ninja

  4. Install

    cmake --install build

    May require root privileges

  5. Uninstall

    CMake doesn't generate an uninstall target by default. To remove installed files, run

    cat build/install_manifest.txt | xargs rm -irv
    
  6. Cleanup build directory

    cmake --build build -t clean

Compilation FreeBSD

Requires at least GCC 10 or Clang 16.

Note that GNU make (gmake) is required to compile on FreeBSD.

With gmake

  1. Install dependencies

    sudo pkg install gmake gcc11 coreutils git lowdown
  2. Clone repository

    git clone https://github.com/aristocratos/btop.git
    cd btop
  3. Compile

    gmake

    Options for make:

    Flag Description
    VERBOSE=true To display full compiler/linker commands
    STATIC=true For static compilation (only libgcc and libstdc++)
    QUIET=true For less verbose output
    STRIP=true To force stripping of debug symbols (adds -s linker flag)
    DEBUG=true Sets OPTFLAGS to -O0 -g and enables more verbose debug logging
    ARCH=<architecture> To manually set the target architecture
    FORTIFY_SOURCE=false Disable fortification with _FORTIFY_SOURCE=3
    ADDFLAGS=<flags> For appending flags to both compiler and linker
    CXX=<compiler> Manually set which compiler to use

    Example: gmake ADDFLAGS=-march=native might give a performance boost if compiling only for your own system.

  4. Install

    sudo gmake install

    Append PREFIX=/target/dir to set target, default: /usr/local

    Notice! Only use "sudo" when installing to a NON user owned directory.

  5. (Recommended) Set suid bit to make btop always run as root (or other user)

    sudo gmake setuid

    No need for sudo to see information for non user owned processes and to enable signal sending to any process.

    Run after make install and use same PREFIX if any was used at install.

    Set SU_USER and SU_GROUP to select user and group, default is root and wheel

  • Uninstall

    sudo gmake uninstall
  • Remove any object files from source dir

    gmake clean
  • Remove all object files, binaries and created directories in source dir

    gmake distclean
  • Show help

    gmake help

With CMake (Community maintained)

  1. Install build dependencies

    Requires Clang / GCC, CMake, Ninja, Lowdown and Git

    Note: LLVM's libc++ shipped with FreeBSD 13 is too old and cannot compile btop.

    FreeBSD 14 and later:

    pkg install cmake ninja lowdown

    FreeBSD 13:

    pkg install cmake gcc13 ninja lowdown
  2. Clone the repository

    git clone https://github.com/aristocratos/btop.git && cd btop
  3. Compile

    FreeBSD 14 and later:

    # Configure
    cmake -B build -G Ninja
    # Build
    cmake --build build

    FreeBSD 13:

    # Configure
    CXX=g++13 cmake -B build -G Ninja
    # Build
    cmake --build build

    This will automatically build a release version of btop.

    Some useful options to pass to the configure step:

    Configure flag Description
    -DBTOP_STATIC=<ON|OFF> Enables static linking (OFF by default)
    -DBTOP_LTO=<ON|OFF> Enables link time optimization (ON by default)
    -DBTOP_USE_MOLD=<ON|OFF> Use mold to link btop (OFF by default)
    -DBTOP_PEDANTIC=<ON|OFF> Compile with additional warnings (OFF by default)
    -DBTOP_WERROR=<ON|OFF> Compile with warnings as errors (OFF by default)
    -DBTOP_FORTIFY=<ON|OFF> Detect buffer overflows with _FORTIFY_SOURCE=3 (ON by default)
    -DCMAKE_INSTALL_PREFIX=<path> The installation prefix ('/usr/local' by default)

    Note: Static linking does not work with GCC.

    To force any other compiler, run CXX=<compiler> cmake -B build -G Ninja

  4. Install

    cmake --install build

    May require root privileges

  5. Uninstall

    CMake doesn't generate an uninstall target by default. To remove installed files, run

    cat build/install_manifest.txt | xargs rm -irv
    
  6. Cleanup build directory

    cmake --build build -t clean

Compilation OpenBSD

Requires at least GCC 10.

Note that GNU make (gmake) is required to compile on OpenBSD.

With gmake

  1. Install dependencies

    pkg_add gmake gcc%11 g++%11 coreutils git lowdown
  2. Clone repository

    git clone https://github.com/aristocratos/btop.git
    cd btop
  3. Compile

    gmake CXX=eg++

    Options for make:

    Flag Description
    VERBOSE=true To display full compiler/linker commands
    STATIC=true For static compilation (only libgcc and libstdc++)
    QUIET=true For less verbose output
    STRIP=true To force stripping of debug symbols (adds -s linker flag)
    DEBUG=true Sets OPTFLAGS to -O0 -g and enables more verbose debug logging
    ARCH=<architecture> To manually set the target architecture
    FORTIFY_SOURCE=false Disable fortification with _FORTIFY_SOURCE=3
    ADDFLAGS=<flags> For appending flags to both compiler and linker
    CXX=<compiler> Manually set which compiler to use

    Example: gmake ADDFLAGS=-march=native might give a performance boost if compiling only for your own system.

  4. Install

    sudo gmake install

    Append PREFIX=/target/dir to set target, default: /usr/local

    Notice! Only use "sudo" when installing to a NON user owned directory.

  5. (Recommended) Set suid bit to make btop always run as root (or other user)

    sudo gmake setuid

    No need for sudo to see information for non user owned processes and to enable signal sending to any process.

    Run after make install and use same PREFIX if any was used at install.

    Set SU_USER and SU_GROUP to select user and group, default is root and wheel

  • Uninstall

    sudo gmake uninstall
  • Remove any object files from source dir

    gmake clean
  • Remove all object files, binaries and created directories in source dir

    gmake distclean
  • Show help

    gmake help

With CMake (Community maintained)

  1. Install build dependencies

    Requires GCC, CMake, Ninja, Lowdown and Git

    Note: LLVM's libc++ shipped with OpenBSD 7.4 is too old and cannot compile btop.

    pkg_add cmake g++%11 git ninja lowdown
  2. Clone the repository

    git clone https://github.com/aristocratos/btop.git && cd btop
  3. Compile

    # Configure
    CXX=eg++ cmake -B build -G Ninja
    # Build
    cmake --build build

    This will automatically build a release version of btop.

    Some useful options to pass to the configure step:

    Configure flag Description
    -DBTOP_LTO=<ON|OFF> Enables link time optimization (ON by default)
    -DBTOP_USE_MOLD=<ON|OFF> Use mold to link btop (OFF by default)
    -DBTOP_PEDANTIC=<ON|OFF> Compile with additional warnings (OFF by default)
    -DBTOP_WERROR=<ON|OFF> Compile with warnings as errors (OFF by default)
    -DBTOP_FORTIFY=<ON|OFF> Detect buffer overflows with _FORTIFY_SOURCE=3 (ON by default)
    -DCMAKE_INSTALL_PREFIX=<path> The installation prefix ('/usr/local' by default)

    To force any other compiler, run CXX=<compiler> cmake -B build -G Ninja

  4. Install

    cmake --install build

    May require root privileges

  5. Uninstall

    CMake doesn't generate an uninstall target by default. To remove installed files, run

    cat build/install_manifest.txt | xargs rm -irv
    
  6. Cleanup build directory

    cmake --build build -t clean

Installing the snap

btop

Note: there are now two snaps available: btop and btop-desktop. The desktop version is much larger and includes the desktop entries needed to allow for launching btop with a click.

  • Install the snap

    sudo snap install btop
    or
    sudo snap install btop-desktop
  • Install the latest snap from the edge channel

    sudo snap install btop --edge
    or
    sudo snap install btop-desktop --edge
    
  • Connect the interface

    sudo snap connect btop:removable-media
    or
    sudo snap connect btop-desktop:removable-media

Configurability

All options changeable from within UI. Config and log files stored in $XDG_CONFIG_HOME/btop or $HOME/.config/btop folder

btop.conf: (auto generated if not found)

#? Config file for btop v. 1.2.2

#* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes.
#* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes"
color_theme = "Default"

#* If the theme set background should be shown, set to False if you want terminal background transparency.
theme_background = True

#* Sets if 24-bit truecolor should be used, will convert 24-bit colors to 256 color (6x6x6 color cube) if false.
truecolor = True

#* Set to true to force tty mode regardless if a real tty has been detected or not.
#* Will force 16-color mode and TTY theme, set all graph symbols to "tty" and swap out other non tty friendly symbols.
force_tty = False

#* Define presets for the layout of the boxes. Preset 0 is always all boxes shown with default settings. Max 9 presets.
#* Format: "box_name:P:G,box_name:P:G" P=(0 or 1) for alternate positions, G=graph symbol to use for box.
#* Use whitespace " " as separator between different presets.
#* Example: "cpu:0:default,mem:0:tty,proc:1:default cpu:0:braille,proc:0:tty"
presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:default cpu:0:block,net:0:tty"

#* Set to True to enable "h,j,k,l,g,G" keys for directional control in lists.
#* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift.
vim_keys = False

#* Rounded corners on boxes, is ignored if TTY mode is ON.
rounded_corners = True

#* Default symbols to use for graph creation, "braille", "block" or "tty".
#* "braille" offers the highest resolution but might not be included in all fonts.
#* "block" has half the resolution of braille but uses more common characters.
#* "tty" uses only 3 different symbols but will work with most fonts and should work in a real TTY.
#* Note that "tty" only has half the horizontal resolution of the other two, so will show a shorter historical view.
graph_symbol = "braille"

# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_cpu = "default"

# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_mem = "default"

# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_net = "default"

# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_proc = "default"

#* Manually set which boxes to show. Available values are "cpu mem net proc" and "gpu0" through "gpu5", separate values with whitespace.
shown_boxes = "proc cpu mem net"

#* Update time in milliseconds, recommended 2000 ms or above for better sample times for graphs.
update_ms = 1500

#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu responsive",
#* "cpu lazy" sorts top process over time (easier to follow), "cpu responsive" updates top process directly.
proc_sorting = "cpu lazy"

#* Reverse sorting order, True or False.
proc_reversed = False

#* Show processes as a tree.
proc_tree = False

#* Use the cpu graph colors in the process list.
proc_colors = True

#* Use a darkening gradient in the process list.
proc_gradient = True

#* If process cpu usage should be of the core it's running on or usage of the total available cpu power.
proc_per_core = True

#* Show process memory as bytes instead of percent.
proc_mem_bytes = True

#* Use /proc/[pid]/smaps for memory information in the process info box (very slow but more accurate)
proc_info_smaps = False

#* Show proc box on left side of screen instead of right.
proc_left = False

#* Sets the CPU stat shown in upper half of the CPU graph, "total" is always available.
#* Select from a list of detected attributes from the options menu.
cpu_graph_upper = "total"

#* Sets the CPU stat shown in lower half of the CPU graph, "total" is always available.
#* Select from a list of detected attributes from the options menu.
cpu_graph_lower = "total"

#* Toggles if the lower CPU graph should be inverted.
cpu_invert_lower = True

#* Set to True to completely disable the lower CPU graph.
cpu_single_graph = False

#* Show cpu box at bottom of screen instead of top.
cpu_bottom = False

#* Shows the system uptime in the CPU box.
show_uptime = True

#* Show cpu temperature.
check_temp = True

#* Which sensor to use for cpu temperature, use options menu to select from list of available sensors.
cpu_sensor = "Auto"

#* Show temperatures for cpu cores also if check_temp is True and sensors has been found.
show_coretemp = True

#* Set a custom mapping between core and coretemp, can be needed on certain cpus to get correct temperature for correct core.
#* Use lm-sensors or similar to see which cores are reporting temperatures on your machine.
#* Format "x:y" x=core with wrong temp, y=core with correct temp, use space as separator between multiple entries.
#* Example: "4:0 5:1 6:3"
cpu_core_map = ""

#* Which temperature scale to use, available values: "celsius", "fahrenheit", "kelvin" and "rankine".
temp_scale = "celsius"

#* Use base 10 for bits/bytes sizes, KB = 1000 instead of KiB = 1024.
base_10_sizes = False

#* Show CPU frequency.
show_cpu_freq = True

#* Draw a clock at top of screen, formatting according to strftime, empty string to disable.
#* Special formatting: /host = hostname | /user = username | /uptime = system uptime
clock_format = "%H:%M"

#* Update main ui in background when menus are showing, set this to false if the menus is flickering too much for comfort.
background_update = True

#* Custom cpu model name, empty string to disable.
custom_cpu_name = ""

#* Optional filter for shown disks, should be full path of a mountpoint, separate multiple values with whitespace " ".
#* Begin line with "exclude=" to change to exclude filter, otherwise defaults to "most include" filter. Example: disks_filter="exclude=/boot /home/user".
disks_filter = "exclude=/boot"

#* Show graphs instead of meters for memory values.
mem_graphs = True

#* Show mem box below net box instead of above.
mem_below_net = False

#* Count ZFS ARC in cached and available memory.
zfs_arc_cached = True

#* If swap memory should be shown in memory box.
show_swap = True

#* Show swap as a disk, ignores show_swap value above, inserts itself after first disk.
swap_disk = True

#* If mem box should be split to also show disks info.
show_disks = True

#* Filter out non physical disks. Set this to False to include network disks, RAM disks and similar.
only_physical = True

#* Read disks list from /etc/fstab. This also disables only_physical.
use_fstab = False

#* Set to true to show available disk space for privileged users.
disk_free_priv = False

#* Toggles if io activity % (disk busy time) should be shown in regular disk usage view.
show_io_stat = True

#* Toggles io mode for disks, showing big graphs for disk read/write speeds.
io_mode = False

#* Set to True to show combined read/write io graphs in io mode.
io_graph_combined = False

#* Set the top speed for the io graphs in MiB/s (100 by default), use format "mountpoint:speed" separate disks with whitespace " ".
#* Example: "/mnt/media:100 /:20 /boot:1".
io_graph_speeds = ""

#* Set fixed values for network graphs in Mebibits. Is only used if net_auto is also set to False.
net_download = 100

net_upload = 100

#* Use network graphs auto rescaling mode, ignores any values set above and rescales down to 10 Kibibytes at the lowest.
net_auto = True

#* Sync the auto scaling for download and upload to whichever currently has the highest scale.
net_sync = False

#* Starts with the Network Interface specified here.
net_iface = "br0"

#* Show battery stats in top right if battery is present.
show_battery = True

#* Which battery to use if multiple are present. "Auto" for auto detection.
selected_battery = "Auto"

#* Set loglevel for "~/.config/btop/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG".
#* The level set includes all lower levels, i.e. "DEBUG" will show all logging info.
log_level = "DEBUG"

Command line options

usage: btop [-h] [-v] [-/+t] [-p <id>] [--utf-force] [--debug]

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show version info and exit
  -lc, --low-color      disable truecolor, converts 24-bit colors to 256-color
  -t, --tty_on          force (ON) tty mode, max 16 colors and tty friendly graph symbols
  +t, --tty_off         force (OFF) tty mode
  -p, --preset <id>     start with preset, integer value between 0-9
  --utf-force           force start even if no UTF-8 locale was detected
  --debug               start in DEBUG mode: shows microsecond timer for information collect
                        and screen draw functions and sets loglevel to DEBUG

LICENSE

Apache License 2.0

btop's People

Contributors

0xjoemama avatar aristocratos avatar correabuscar avatar crestfallnatwork avatar hirokoclanger avatar iambeingtracked avatar imwints avatar ivanp7 avatar jan-guenter avatar joske avatar kz6fittycent avatar lvxnull avatar martinpit avatar masiboss avatar mattico avatar ottok avatar pallebone avatar pg83 avatar romner-set avatar shrirajhegde avatar simplepad avatar smhd001 avatar stefanos82 avatar stradicat avatar superty avatar syndelis avatar thecoder-001 avatar vsey avatar yonatan8070 avatar zkourouma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

btop's Issues

Update total memory while running

I often use Linux in a Hyper-V VM for development which has dynamic memory allocation enabled. btop never changes the total memory after it is launched. That means when Hyper-V allocates more or less memory to the VM all memory stats become incorrect. I have to use htop instead since it updates the total memory while running. Othewise I love it.

[REQUEST] Make use of notcurses

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Provide a better TUI experience than what ncurses provides along with allowing Windows support eventually.
https://github.com/dankamongmen/notcurses
Describe the solution you'd like
A clear and concise description of what you want to happen.
I want to see better performance and graphics that notcurses provides that ncurses does not.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Do nothing.
Additional context
Add any other context or screenshots about the feature request here.
It's a cross-platform Apache2 licensed library that's available in many Linux distribution package managers as well as Brew/Macports. It also provides C++ wrappers so that you don't need to use C code (which would be sub-optimal in a C++ project) with extensive documentation and discussion threads to help answer any questions you may have on how to use it.

[BUG] RAID-0 array doesn't show up

My 4 TB RAID-0 array doesn't show up. Also, my 4 TB RAID-1 array shows up as 2.41 GiB.

Screen Shot 2021-09-24 at 9 41 59 AM

Screen Shot 2021-09-24 at 9 34 15 AM

Info (please complete the following information):

  • btop++ version: 1.0.6
  • Binary: static binary btop-1.0.6-linux-i686.tbz
  • (Linux) Kernel: 5.4.0-84-generic
  • Terminal used: bash
  • Font used: Default Linux Mint terminal font: Ubuntu Mono Regular

[BUG] CPU name is cut off

Describe the bug

[A clear and concise description of what the bug is.]

To Reproduce

[Steps to reproduce the behavior:]

Expected behavior

[A clear and concise description of what you expected to happen.]

Screenshots

image

Just missing the 5 at the end: Pentium Silver J5005

Info (please complete the following information):

  • btop++ version: btop -v 1.0.13
  • Binary: [self compiled or static binary from release] self compiled

[REQUEST] Cosmetic - CPU Graph rendering improvement

Is it not possible to make the CPU box a bit bigger when there are only 2 or 4 cores? On AMD it looks a bit squashed.
image

Describe the solution you'd like
As there are only 2 cores on my VM the AMD CPU Model name is not displayed optimally.

Can the box not be sized on the core count ( > 4 ) , and if Temperature is being displayed, to dynamically size it? I see that the box is already sized on the height of the terminal window. Maybe make it configurable that if the temperature is not displayed to allow that space to be used for displaying the CPU core load using that space? Making the Core graph a bit wider and a bit taller.

Or scroll the text when you click the CPU model?

[BUG] btop crashes over SSH when UsePAM is set to no

Describe the bug

When attempting to run on a Raspberry Pi 2, btop crashes immediately.

To Reproduce

  1. Download btop for armhf, extract and install
  2. Run it

Expected behavior

The program starts properly with no errors.

Screenshots

Terminal output:

pi@raspberrypi:~/btop $ sudo make install

 ██████╗ ████████╗ ██████╗ ██████╗
 ██╔══██╗╚══██╔══╝██╔═══██╗██╔══██╗   ██╗    ██╗
 ██████╔╝   ██║   ██║   ██║██████╔╝ ██████╗██████╗
 ██╔══██╗   ██║   ██║   ██║██╔═══╝  ╚═██╔═╝╚═██╔═╝
 ██████╔╝   ██║   ╚██████╔╝██║        ╚═╝    ╚═╝
 ╚═════╝    ╚═╝    ╚═════╝ ╚═╝      Installer

Installing binary to: /usr/local/bin/btop
Installing doc to: /usr/local/share/btop
Installing themes to: /usr/local/share/btop/themes
pi@raspberrypi:~/btop $ sudo make setuid
File: /usr/local/bin/btop
Setting owner root:root
Setting SUID bit
pi@raspberrypi:~/btop $ btop
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_M_construct null not valid
Aborted

Info (please complete the following information):

  • btop++ version: btop version: 1.0.2
  • Architecture: armv7l
  • Platform: Linux (Raspberry Pi OS 2021-05-07)
  • Linux Kernel: 5.10.60-v7+
  • Terminal used: PuTTY over SSH
  • Font used: Source Code Pro Semibold

Additional context

Logs are very unhelpful:

2021/09/21 (01:24:34) | ===> btop++ v.1.0.2
2021/09/21 (01:24:34) | DEBUG: Starting in DEBUG mode!
2021/09/21 (01:24:34) | INFO: Logger set to DEBUG

[end of log file]

[BUG] application freezed, does not respond to keyboard/mouse input.

Describe the bug

[A clear and concise description of what the bug is.]

To Reproduce

randomly scroll process list.

Expected behavior

[A clear and concise description of what you expected to happen.]

Screenshots

[If applicable, add screenshots to help explain your problem.]

Info (please complete the following information):

  • btop++ version: master
  • Binary: self compiled
  • (If compiled) Compiler and version:gcc version 11.1.0 (GCC)
  • Architecture: [x86_64, aarch64, etc.] x86_64
  • Platform: Linux
  • (Linux) Kernel: 5.14.0-0-MANJARO
  • (OSX/FreeBSD) Os release version:
  • Terminal used: iterm2/fish
  • Font used:

Additional context

contents of ~/.config/btop/btop.log

(try running btop with --debug flag if error.log is empty)

GDB Backtrace

Thread 2 (LWP 2749 "btop"):
#0 0x00007f2bc7bd0a9d in syscall () from /usr/lib/libc.so.6
#1 0x0000563a794fda5e in void std::__detail::__platform_wait(int const*, int) ()
#2 0x0000563a795516c7 in Runner::_runner(void*) ()
#3 0x00007f2bc7cad299 in start_thread () from /usr/lib/libpthread.so.0
#4 0x00007f2bc7bd6053 in clone () from /usr/lib/libc.so.6
Thread 1 (LWP 2748 "btop"):
#0 0x00007f2bc7cb687c in read () from /usr/lib/libpthread.so.0
#1 0x00007f2bc7eed662 in std::__basic_file::xsgetn (this=this@entry=0x7f2bc8037b08 <__gnu_internal::buf_cin+104>, __s=0x563a7996ddd0 "\033[A0;122;33m\033[<0;114;34m\033[<65;97;45M\033[<65;97;45M\033[<65;97;45M\033[<65;97;45M\033[<65;97;45M\033[<65;97;45M\033[<65;97;45M\033[<65;97;45M\033[<65;97;45M\033[<65;97;45M\033[<65;97;45M\033[<65;97;45M\033[<65;97;45M", __n=__n@entry=8191) at basic_file.cc:331
#2 0x00007f2bc7f2eb61 in std::basic_filebuf<char, std::char_traits >::underflow (this=0x7f2bc8037aa0 <__gnu_internal::buf_cin>) at /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/streambuf:487
#3 0x00007f2bc7ec7ee1 in std::basic_streambuf<char, std::char_traits >::sgetc (this=0x7f2bc8037aa0 <__gnu_internal::buf_cin>) at /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/streambuf:343
#4 std::basic_streambuf<char, std::char_traits >::sgetc (this=) at /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/streambuf:343
#5 std::basic_streambuf<char, std::char_traits >::snextc (this=) at /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/streambuf:308
#6 std::istream::ignoreXX (this=0x7f2bc80385a0 std::cin, __n=9223372036854775807) at /build/gcc/src/gcc/libstdc++-v3/src/c++98/compatibility.cc:96
#7 0x0000563a7951fa67 in Input::getabi:cxx11 ()
#8 0x0000563a794e2abd in main ()

[REQUEST] Use theme in banner and options

Describe the solution you'd like
Any chance there's already a built in way to change the banner colors to the theme selected?
Or maybe just print it out as text instead of ASCII art. The banner doesn't match the theme that i'm using at all right now (nord), cheers

[BUG] ERROR: Runner thread died unexpectedly! SXHKD

Describe the bug
btop crashes quite a few times while attempting to launch it via sxhkd

2021/09/21 (08:49:04) | ===> btop++ v.1.0.2
2021/09/21 (08:49:04) | ERROR: Runner thread died unexpectedly!

It works just fine when I manually launch my terminal and type btop

My sxhkd config:

# btop++ process viewer
super + b
	alacritty -e btop

To Reproduce
Attempt to launch btop via sxhkd

Info (please complete the following information):

  • btop++ version: 1.0.2
  • Architecture: x86_64
  • Platform: Arch Linux
  • (Linux) Kernel: 5.14.6-arch1-1
  • Terminal used: alacritty
  • Font used: jetbrains nerd fonts mono

[REQUEST] Distribute as Flatpak and/or Snap

A lot of users across various Linux Distros would have convenient access to this application if it were distributed as Flatpak and/or Snap. It would also greatly help discoverability of this application if it was published there.

Have you considered publishing this as a Flatpak on Flathub and/or as a Snap on the Snap store? Flatpak is the more popular universal app format out of the two (because it's more open by design), so if you had to choose only one, I'd go with Flatpak.

[REQUEST] custom thread names

gdb, ps and htop can display custom thread names, the 16 char name of the thread explicitly written in by a developer. it would be useful to have either a column with this, or the option to add the column.

[BUG] Process tree view don't disappear on collapse a branch

Describe the bug

When I close a branch in the process tree view, the processes under that branch are moved to the bottom of the list.

To Reproduce

Close a branch and scroll down to the end of the list.

Expected behavior

The processes should disappear.

Screenshots

screenshot-1
screenshot-2
screenshot-3

Info (please complete the following information):

  • btop++ version: 1.0.5
  • Binary: self compiled
  • (If compiled) Compiler and version: 11.1.0, 10.2.0
  • Architecture: x86_64, armv7l
  • Platform: Linux
  • (Linux) Kernel: 5.14.6-zen1-1-zen, 5.10.63-9-ARCH
  • (OSX/FreeBSD) Os release version:
  • Terminal used: urxvt, st, tty

[BUG] - text wrapping in CPU graph - btop 1.0.4

Describe the bug

There is some text from the Load Average that spans to the next line.

To Reproduce

This happens to me all the time.

Expected behavior

Load AVG Should not span across multiple lines.

btop-1 0 04

[REQUEST] distribute application via AUR as package

Amazing work, very nice system monitor!
I would love to see btop being distributed as a package on the Arch User Repository (AUR). Writing the PKGBUILD should be quite straight forward. The setuid step of the installation could be a question to ask during that install.
I might even go ahead and submit a PR for this if I find some time to check out how the best practices for C++ apps are.

[REQUEST] homebrew formula

Hi @aristocratos ,

Hope you are all well !

I was wondering if it would be possible to create an homebrew formula for your great project :-)

Ps. apt package also ^^

Cheers,
Luc Michalski

[REQUEST] Stats filtered per cgroup container/namespace

Is your feature request related to a problem? Please describe.
No.

Describe the solution you'd like
All statistics already present in btop, but filtered in a per-cgroup basis.

Describe alternatives you've considered
top and htop are tools that can show which cgroup container a process is running on, but that's about it.

Additional context
In a context where containers (Docker, LXC, podman, containerd, etc.) are commonly used, I believe having the ability to filter statistics for each container for debugging purposes is a 'must' feature to have.

[BUG]

I compile btop from the source code last night
coredump when I run btop
here is my gdb info:
image
my env:
image

next I download the release binary btop which update 9 hours ago,it works,hope that bug is fix

[BUG] Btop hangs

Describe the bug
For some reason btop randomly hangs (after a couple of mins or hours), CPU jumps to 100% for btop process.

To Reproduce
Not sure since it's random. Installed from snap edge though.

Expected behavior

Screenshots

[If applicable, add screenshots to help explain your problem.]

Info (please complete the following information):

  • btop++ version: bpytop -v: 1.0.9
  • Architecture: [x86_64, aarch64, etc.] uname -m
  • Platform: [Linux, FreeBSD, OsX]: Ubuntu 21.04
  • (Linux) Kernel: uname -r: 5.11.0.0-36-generic
  • Terminal used: byobu
  • Font used: default byobu fonts

Additional context

contents of ~/.config/btop/btop.log: doesn't exist, only btop.conf

(try running btop with --debug flag if error.log is empty): OK

[BUG] ERROR: Exception in runner thread -> Net:: -> stoul

Ubuntu 18.04 after running btop command it immediately quits with message:
ERROR: Exception in runner thread -> Net:: -> stoul

I've tried to set net_iface to wlo1 but no luck, I can confirm files like /sys/class/net/wlo1/statistics/tx_bytes and /sys/class/net/wlo1/statistics/rx_bytes are present

Info (please complete the following information):

  • btop++ version: 1.0.11
  • Binary: static
  • Architecture: x86_64
  • Platform: Linux
  • (Linux) Kernel: 5.4.0-84-generic

Additional context

contents of ~/.config/btop/btop.log

2021/09/30 (19:58:49) | ===> btop++ v.1.0.11
2021/09/30 (19:58:49) | DEBUG: Starting in DEBUG mode!
2021/09/30 (19:58:49) | INFO: Logger set to DEBUG
2021/09/30 (19:58:49) | DEBUG: Setting LC_ALL=en_US.UTF-8
2021/09/30 (19:58:49) | INFO: Running on /dev/pts/2
2021/09/30 (19:58:49) | ERROR: Exception in runner thread -> Net:: -> stoul
2021/09/30 (19:58:49) | INFO: Quitting! Runtime: 00:00:00

GDB Backtrace

If btop++ is crashing at start the following steps could be helpful:

  1. run gdb btop

  2. r to run, wait for crash and press enter

  3. bt to get backtrace

  4. Copy and paste the backtrace here:

Starting program: /usr/local/bin/btop 
ERROR: Exception in runner thread -> Net:: -> stoul
[Inferior 1 (process 26102) exited with code 01]
(gdb) bt
No stack.

[REQUEST] Add graphic protocol support

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Add support for Sixel, Kitty, and Iterm2's graphic protocols. Take a look at https://github.com/hackerb9/lsix for example (which just does Sixel).
Describe the solution you'd like
A clear and concise description of what you want to happen.
Add support for the graphic protocols in order to improve graphics further, and in some cases potentially boost performance as well. On Linux, start with detecting Kitty support. Kitty and Wezterm both support the Kitty protocol and notcurses favors this support when available, otherwise detect Sixel. Otherwise ignore altogether. On Mac, look for Iterm2 graphics protocol support (assuming you're not running on the aforementioned terminals), if it's not there, then search for Sixel and if that's not available, ignore there too.

Notcurses also has a fall-back layer where graphics protocols aren't supported, it will display things as best it can, which is still pretty well, if not quite as good which can make notcurses an optional dependency of this feature request (you may need to do very little as notcurses does detection for all 3 protocols).
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Do nothing.
Additional context
Add any other context or screenshots about the feature request here.

[REQUEST] Add night-owl theme

Describe the solution you'd like
include a night-owl.theme file in the default options

Describe alternatives you've considered
i've already implemented it for myself and wanted to share it

Additional context
this theme is inspired by the original VS Code version by sdras

[BUG] building from source on alpine linux 3.14.2 x8_64

Describe the bug

Building failing on Alpine linux 3.14.2 x86_64

To Reproduce

Linux alpine 4.9.65-1-hardened #2-Alpine SMP Mon Nov 27 15:36:10 GMT 2017 x86_64 GNU/Linux
alpine:~$ more /etc/alpine-release 
3.14.2
alpine:~$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-alpine-linux-musl/10.3.1/lto-wrapper
Target: x86_64-alpine-linux-musl
Configured with: /home/buildozer/aports/main/gcc/src/gcc-10.3.1_git20210424/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --build=x86_64-alpine-linux-musl --host=x86_64-alpine-linux-musl --target=x86_64-alpine-linux-musl --with-pkgversion='Alpine 10.3.1_git20210424' --enable-checking=release --disable-fixed-point --disable-libstdcxx-pch --disable-multilib --disable-nls --disable-werror --disable-symvers --enable-__cxa_atexit --enable-default-pie --enable-default-ssp --enable-cloog-backend --enable-languages=c,c++,d,objc,go,fortran,ada --disable-libssp --disable-libmpx --disable-libmudflap --disable-libsanitizer --enable-shared --enable-threads --enable-tls --with-system-zlib --with-linker-hash-style=gnu
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.3.1 20210424 (Alpine 10.3.1_git20210424) 
alpine:~$ 

Expected behavior

building without errors

Screenshots

alpine:~/btop-1.0.2$ make
 
 ██████╗ ████████╗ ██████╗ ██████╗
 ██╔══██╗╚══██╔══╝██╔═══██╗██╔══██╗   ██╗    ██╗
 ██████╔╝   ██║   ██║   ██║██████╔╝ ██████╗██████╗
 ██╔══██╗   ██║   ██║   ██║██╔═══╝  ╚═██╔═╝╚═██╔═╝
 ██████╔╝   ██║   ╚██████╔╝██║        ╚═╝    ╚═╝
 ╚═════╝    ╚═╝    ╚═════╝ ╚═╝      Makefile v1.2
PLATFORM   ?| Linux
ARCH       ?| x86_64
CXX        ?| g++ (10.3.1)
THREADS    :| auto
REQFLAGS   !| -std=c++20
WARNFLAGS  :| -Wall -Wextra -pedantic
OPTFLAGS   :| -O2 -ftree-loop-vectorize -flto=auto
LDCXXFLAGS :| -pthread -D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector -fstack-clash-protection -fcf-protection
CXXFLAGS   +| $(REQFLAGS) $(LDCXXFLAGS) $(OPTFLAGS) $(WARNFLAGS)
LDFLAGS    +| $(LDCXXFLAGS) $(OPTFLAGS) $(WARNFLAGS)

Building btop++ (v1.0.2)
<...>
Linking and optimizing binary...
/usr/include/c++/10.3.1/ext/string_conversions.h: In function '__to_xstring.constprop':
/usr/include/fortify/stdio.h:70:28: error: inlining failed in call to 'always_inline' 'vsnprintf': function body can be overwritten at link time
   70 | _FORTIFY_FN(vsnprintf) int vsnprintf(char *__s, size_t __n, const char *__f,
      |                            ^
/usr/include/c++/10.3.1/ext/string_conversions.h:111:32: note: called from here
  111 |       const int __len = __convf(__s, __n, __fmt, __args);
      |                                ^
make[1]: *** [/tmp/ccLbJlLP.mk:56: /tmp/btop.OglgLe.ltrans18.ltrans.o] Error 1
lto-wrapper: fatal error: make returned 2 exit status
compilation terminated.
/usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make: *** [Makefile:167: btop] Error 1

[BUG] Proc per core over 999% usage

Describe the bug

When a process uses over 999% with proc per core = true (more than 10 cores), btop prints the usage on 3 digits and truncate last numbers.

To Reproduce

  1. Have a CPU with over 10 cores
  2. install sysbench
  3. sysbench cpu --threads=nproc run
  4. watch btop which doesn't scale the cpu usage over 3 digits

Expected behavior

btop prints cpu usage on more than 3 digits (e.g. 1400%)

Screenshots

image

Info (please complete the following information):

  • btop++ version: 1.0.9
  • Binary: static binary from release
  • (If compiled) Compiler and version:
  • Architecture: [x86_64, aarch64, etc.] x86_64
  • Platform: Linux (WSL2)
  • (Linux) Kernel: 5.4.72-microsoft-standard-WSL2
  • (OSX/FreeBSD) Os release version:
  • Terminal used: Windows terminal + tmux
  • Font used: MeslolGS NF

[BUG] Terminal keeps text formatting after make install

Describe the bug

After install, the terminal keeps the text setting of white/bold

To Reproduce

I downloaded the linux x86-64 tbz file -

mkdir btop
wget https://github.com/aristocratos/btop/releases/download/v1.0.4/btop-1.0.4-linux-x86-64.tbz
PREFIX=test make install

My term is still bold white.

Expected behavior

I expect my term to reset.

I looked in the makefile and it's missing a \033[0m on the last printf statement in the install.

Screenshots

First run is before makefile modification, second is after.

image

[REQUEST] last processor column

It is often useful when monitoring the system to see if affinities are set as expected. the PROCESSOR column in htop, corresponding to the last processor that a process/thread was scheduled on would be a great addition as an optional column

Identical download and upload values

Hello,

Awesome update of htop so far, thanks for your work.
Only thing I've noted so far is that download and upload values are the same :
image

  • btop++ version: 1.06
  • Binary: complied with make STATIC=true
  • (If compiled) Compiler and version: gcc-10 10.2.1
  • Architecture: x86_64
  • Platform: Linux
  • (Linux) Kernel: 5.10.0-8-amd64
  • (OSX/FreeBSD) Os release version:Debian 11

Logs :

2021/09/24 (09:40:25) | ===> btop++ v.1.0.6
2021/09/24 (09:40:25) | DEBUG: Starting in DEBUG mode!
2021/09/24 (09:40:25) | INFO: Logger set to DEBUG
2021/09/24 (09:40:25) | DEBUG: Setting LC_ALL=fr_FR.UTF-8
2021/09/24 (09:40:25) | INFO: Running on /dev/pts/0
2021/09/24 (09:40:32) | INFO: Quitting! Runtime: 00:00:07

[REQUEST] put some configuration into cache

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I notice two issues:

  1. When I update my btop to a new version, the version number in the first line ~/.config/btop/btop.conf file will change
  2. when I exit btop with a different layout, some parts of the btop.conf will be different

The btop.conf file should only be modified when you manually modify it.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Put those parts that are easy to change into another file such as ~/.cache/btop/btop.conf, since I sync my btop.conf with git in dotfiles, every time the btop changes, it is annoying that I got a new modification in my dotfiles.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Error while running on WSL 1.0

Dear community:

I have tried to install the latest version of btop inside of WSL 1.0 and encountered some issue. After the installation process has finished successfully, I tried to launch btop, but there is only an error message showing up:

-bash: /usr/local/bin/btop: cannot execute binary file: Exec format error

Did someone encounter this problem before, or know the solution for this problem?

regards:

Benedikt

[REQUEST] AppImage release option

Hello,

Thank you for this resource monitoring utility, but may I recommend that you consider package it as an AppImage for easy of use and wider adoption, please.

AppImages are very easy to create and can easily be automated for new releases.

[BUG] CPU over 100% usage

Describe the bug

While compiling something my CPU spikes over 100% well into the 300% area in the proc tree

It might be interesting to note that it only occured when a single process was going ham at the cpu, if i compile clang++ over multiple processes i have no problem anymore

To Reproduce

Compile unreal engine from source

Expected behavior

CPU Should be maxed at 100% with all proc combined

Screenshots

Bug example
Bug example

Working example
Working example

Info (please complete the following information):

  • btop++ version: btop version: 1.0.4
  • Binary: static binary from release
  • Architecture: x86_64
  • Platform: Linux
  • (Linux) Kernel: 5.13.0-7614-generic
  • (OSX/FreeBSD) Os release version: Pop!_OS 21.04
  • Terminal used: Alacritty
  • Font used: MesloLGS

2021/09/22 (09:29:34) | ===> btop++ v.1.0.4 2021/09/22 (09:29:34) | ERROR: Terminal size to small for current config. (WxH) Current: 94x22 | Needed: 80x24 Resize terminal or disable some boxes in config file to fix this.

Deps: Add Chromium Math and Dynamic Bitset with libpopcnt to improve safety and perf

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Add safer math than <cmath>. https://github.com/chromium/chromium/tree/master/base/numerics
Your response in the C++ suggestion discussion thread in bpytop:

dynamic_bitset and libpopcnt looks interesting though, I'm currently trying to optimize out some unnecessary string parsing in loops using std::bitset.

Also lastly, add https://github.com/microsoft/mimalloc to your build steps to improve allocation performance significantly. This will require #28 as it's extremely easy to add to Cmake file.

Describe the solution you'd like
A clear and concise description of what you want to happen.
Improved safety of the C++ code, better performance and other optimizations.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Do nothing.

Additional context
Add any other context or screenshots about the feature request here.

[REQUEST] pick geometry/orientation for panels

It would be useful to pick the orientation of the windows. the default works well for "landscape" windows, but not for "portrait" type windows. for instance, i might want procs and network stacked one on top of the other.
i guess the orientation options as they are are too restrictive: maybe let the user pick left/right/top/bottom for any panel.

[BUG] ERROR: Exception in runner thread

Describe the bug

ERROR: Exception in runner thread -> Proc:: -> array::at: __n (which is 18446744071562068066) >= _Nm (which is 101)

To Reproduce

Run btop and wait

Expected behavior

Handling an exception with code

Screenshots

Info (please complete the following information):

  • btop++ version: btop version: 1.0.1
  • Architecture: [x86_64, aarch64, etc.] x86_64
  • Platform: Linux
  • (Linux) Kernel: 5.14.1
  • (OSX/FreeBSD) Os release version:
  • Terminal used: Konsole
  • Font used: terminus

Additional context

contents of ~/.config/btop/error.log: empty

contents of ~/.config/btop/btop.log:

2021/09/20 (11:20:41) | ===> btop++ v.1.0.1
2021/09/20 (11:20:41) | ERROR: Exception in runner thread -> Proc:: -> array::at: __n (which is 18446744071562068063) >= _Nm (which is 101)

2021/09/20 (11:39:42) | ===> btop++ v.1.0.1
2021/09/20 (11:39:42) | ERROR: Exception in runner thread -> Proc:: -> array::at: __n (which is 18446744071562068063) >= _Nm (which is 101)

2021/09/20 (12:29:13) | ===> btop++ v.1.0.1
2021/09/20 (12:29:13) | ERROR: Exception in runner thread -> Proc:: -> array::at: __n (which is 18446744071562068066) >= _Nm (which is 101)

2021/09/20 (15:19:59) | ===> btop++ v.1.0.1
2021/09/20 (15:19:59) | ERROR: Exception in runner thread -> Proc:: -> array::at: __n (which is 18446744071562068066) >= _Nm (which is 101)

2021/09/20 (15:32:25) | ===> btop++ v.1.0.1
2021/09/20 (15:32:25) | DEBUG: Starting in DEBUG mode!
2021/09/20 (15:32:25) | INFO: Logger set to DEBUG
2021/09/20 (15:32:25) | DEBUG: Setting LC_ALL=ru_RU.utf8
2021/09/20 (15:32:25) | INFO: Running on /dev/pts/4
2021/09/20 (17:36:35) | ERROR: Exception in runner thread -> Proc:: -> array::at: __n (which is 18446744071562068068) >= _Nm (which is 101)
2021/09/20 (17:36:35) | INFO: Quitting! Runtime: 02:04:10

Rewrite in Rust

Hi, I think that the program needs just one more FINAL rewrite but this time in the powerful HolyC Rust. It would be the final solution to all of our problems. Could you explain why did you rewrote the entire thing for the 2nd time?
PS. Don't take it too seriously. I just couldn't stop laughing on that announcement and couldn't stop myself from writing it. I really appreciate your hard work. Just the situation is a great meme. :D

[BUG] complains of no UTF-8 while locale *is* UTF-8

Describe the bug

Running on RHEL 7.7 at work, using the statically compiled binary 1.0.9, it complains of no UTF-8 locale detected. While locale is:
[jdehaes@berx771 Snape]$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

When using the --utf-force flag, btop works perfectly. We have the same on other RHEL 7.x boxes.
I can not compile/debug btop on this machine (as its compilers are too old - even with gcc 8.3 -std=c++20 is not available). On a RHEL 8 system this just works. I can compile/debug there (after installing gcc 10 toolchain), but useless as the problem doesn't occur there. The locale settings are identical on that system.

To Reproduce

Get a RHEL 7.7 (probably any 7.x will do) system (via docker?) and copy the btop binary. It will complain although locale is UTF-8.

Expected behavior

btop can run with the --utf-force flag.

[jdehaes@berx771 Snape]$ btop
ERROR: No UTF-8 locale detected!
Use --utf-force argument to force start if you're sure your terminal can handle it.

[If applicable, add screenshots to help explain your problem.]

Info (please complete the following information):

  • btop++ version: 1.0.9
  • Binary: static binary from release
  • Architecture: x86_64
  • Platform: Linux
  • (Linux) Kernel: 3.10.0-1062.4.1.el7.x86_64
  • Terminal used: mate-terminal
  • Font used: Noto Mono for Powerline Regular

Additional context

contents of ~/.config/btop/btop.log -> nothing there other than no UTF-8 locale detected.

[BUG]CPU temps are pushed to the right

Describe the bug

When I choose to only display CPU temperatures in pane 1, they end up being pushed to the right and only the first digit is visible.

To Reproduce

Only show the CPU pane (no 1)

Expected behavior

CPU temps should remain visible.

Screenshots
btop-cpu-temp-ok

After a few seconds:

btop-cpu-temp-ko

Info (please complete the following information):

  • btop++ version: 1.0.1 and 1.0.2
  • Binary: static binary from release
  • Architecture: x86_64
  • Platform: Linux
  • (Linux) Kernel: 4.9.0-9-amd64
  • (OSX/FreeBSD) Os release version: Debian 9 (Stretch)
  • Terminal used: QTerminal
  • Font used: Hack Nerd Font

PS: It's doesn't do it on xterm but xterm doesn't show the dots.

[BUG] LDAP users show up as UIDs instead of usernames

In btop, processes run by LDAP users show up with their UIDs instead of usernames in the processes table. I am using OpenLDAP and SSSD for user management, configured according to the ArchWiki. This bug does not occur when using bpytop or htop.

To Reproduce

Run btop on a machine with processes that are being run by LDAP users.

Expected behavior

The LDAP users' usernames should show up in the processes table instead of their UIDs.

Screenshots

image

Info (please complete the following information):

  • btop++ version: 1.0.10
  • Binary: From Arch Linux community repository
  • Architecture: [x86_64, aarch64, etc.]: x86_64
  • Platform: Arch Linux
  • (Linux) Kernel: 5.14.7-arch1-1
  • Terminal used: Konsole
  • Font used: Hack

[REQUEST] add HDD Temperature info

Is your feature request related to a problem? Please describe.
Keeping track of drive temps in my storage array is useful for tuning fan configuration, and this would be particularly in newer builds as ambient temps tend to change throughout the year. As my array sits a rack beside my desk keeping it both cool and quiet is important to me. Having temps available at a glance would be very useful in determining if x hotswap bay really needs a fan or not, or if y fan could be run at lower rpm. Additionally, Kernel 5.5+ is expected expose nvme drive temperatures to hwmon, and that should be extremely useful for keeping watch of their thermals in newer builds. Additionally drives running too hot or too cold can lead to more earlier than expected failure. The ability to keep track of their temps through btop would be of notable utility in this regard.

Describe the solution you'd like
Add hard drive temperatures to data collected and displayed.
I think current temperature alone would be sufficient for my uses- optionally a small graph would be great too.

I suggest the use of hwmon as it doesn't require additional packages. Furthermore, as you've already used hwmon as a collector method for CPU Temp in btop_collect.cpp - using a similar method to get temp1_input for each drive using hwmon's drivetemp module shouldn't be too much of a stretch.

Describe alternatives you've considered
hddtemp and smartctrl are both common solutions to retrieving this data but are are both dependent on installing additional packages. You could well check for them much as you did with various options like coretemp for the cpu temperature.

Additional context
With hwmon's drivetemp module loaded (which it may or may not be by default- sudo modprobe drivetemp should load it on supporting kernel versions if it isn't already) you can grab current temperature in Milli-degrees Celsius from /sys/class/hwmon/hwmon*/temp1_input obviously the value returned would need to be multiplied accordingly (value*0.001) before being displayed.

with the drivetemp module loaded:

  • hwmon drivetemp module will return "drivetemp" in /sys/class/hwmon/hwmon*/name which will be useful in separating drivetemp collection from cpu temp collection.
  • current temperature values for each drive are stored in /sys/class/hwmon/hwmon*/temp1_input
    temp1_input should always be available while the drivetemp module is loaded, additional information such as temp1_min, temp1_max, temp1_lowest, temp1_highest, and temp1_crit values may or may not be set by the drive.
  • you can get the mount (eg: sda,sdb,sdc,etc.) from /sys/class/hwmon/hwmon*/device/block/ for association purposes with info already retrieved from proc and fstab in btop_collect.cpp for displaying under proper drive label
  • you can also notably get the drive model from /sys/class/hwmon/hwmon*/device/model

[BUG] segfault if a non-UTF-8 locale is being used

First of all: Nice work! I'm looking forward to using btop++ on my machines.

Describe the bug

When $LANG has a non-UTF-8 locale set (or a locale without the exact suffix UTF-8, e.g. ´de_DE.utf8`), the program terminates with a segfault.

To Reproduce

$ LANG=de_DE.utf8 ./bin/btop # for a build inside the repo

Expected behavior

The program should accept the locale and start as expected or don't accept the locale and exit with an error message.

Screenshots

No screenshots, but see this gdb output:

$ gdb --args ./bin/btop --debug                                                                                                                                       ✔  183
GNU gdb (Gentoo 10.2 vanilla) 10.2
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./bin/btop...
(gdb) r
Starting program: /home/nex/build/btop/bin/btop --debug
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7c5b15e in __pthread_clockjoin_ex () from /lib64/libpthread.so.0
(gdb) bt
#0  0x00007ffff7c5b15e in __pthread_clockjoin_ex () from /lib64/libpthread.so.0
#1  0x0000555555561c74 in clean_quit (sig=-1) at src/btop.cpp:187
#2  0x0000555555561f40 in _exit_handler () at src/btop.cpp:232
#3  0x00007ffff7ad2f67 in ?? () from /lib64/libc.so.6
#4  0x00007ffff7ad310a in exit () from /lib64/libc.so.6
#5  0x00005555555673b2 in main (argc=2, argv=0x7fffffffd908) at src/btop.cpp:728
(gdb) q
A debugging session is active.

	Inferior 1 [process 47362] will be killed.

Quit anyway? (y or n) y

Info (please complete the following information):

  • btop++ version: 1.0.0
  • Architecture: x86_64
  • Platform: Gentoo Linux
  • (Linux) Kernel: 5.4.80-gentoo-x86_64
  • Terminal used: x11-terms/terminator
  • Font used: Anonymous Pro Regular

Additional context

contents of ~/.config/btop/error.log: file non-existent since the program couldn't start properly

Since I have LANG=de_DE.utf8 set and thus a UTF-8-capable locale, starting btop with --utf-force helped as a workaround. However, the proper behavior should be that LANG=de_DE.utf8 should be recognized as UTF-8-capable locale and thus the program shouldn't even get to the point of trying to generate an error message.

I've already found the offending line:

exit(1);

with a bit of context:

btop/src/btop.cpp

Lines 705 to 728 in 480b421

//? Try to find and set a UTF-8 locale
if (bool found = false; not str_to_upper((string)std::setlocale(LC_ALL, NULL)).ends_with("UTF-8")) {
if (const string lang = (string)getenv("LANG"); str_to_upper(lang).ends_with("UTF-8")) {
found = true;
std::setlocale(LC_ALL, lang.c_str());
}
else if (const string loc = std::locale("").name(); not loc.empty()) {
try {
for (auto& l : ssplit(loc, ';')) {
if (str_to_upper(l).ends_with("UTF-8")) {
found = true;
std::setlocale(LC_ALL, l.substr(l.find('=') + 1).c_str());
break;
}
}
}
catch (const std::out_of_range&) { found = false; }
}
if (not found and Global::utf_force)
Logger::warning("No UTF-8 locale detected! Forcing start with --utf-force argument.");
else if (not found) {
Global::exit_error_msg = "No UTF-8 locale detected!\nUse --utf-force argument to force start if you're sure your terminal can handle it.";
exit(1);

So one issue is that the locale didn't get recognized as UTF-8 properly.
The more important issue here is that btop probably tries to join a pthread which it never created–more or less a use-before-malloc:

btop/src/btop.cpp

Lines 705 to 728 in 480b421

//? Try to find and set a UTF-8 locale
if (bool found = false; not str_to_upper((string)std::setlocale(LC_ALL, NULL)).ends_with("UTF-8")) {
if (const string lang = (string)getenv("LANG"); str_to_upper(lang).ends_with("UTF-8")) {
found = true;
std::setlocale(LC_ALL, lang.c_str());
}
else if (const string loc = std::locale("").name(); not loc.empty()) {
try {
for (auto& l : ssplit(loc, ';')) {
if (str_to_upper(l).ends_with("UTF-8")) {
found = true;
std::setlocale(LC_ALL, l.substr(l.find('=') + 1).c_str());
break;
}
}
}
catch (const std::out_of_range&) { found = false; }
}
if (not found and Global::utf_force)
Logger::warning("No UTF-8 locale detected! Forcing start with --utf-force argument.");
else if (not found) {
Global::exit_error_msg = "No UTF-8 locale detected!\nUse --utf-force argument to force start if you're sure your terminal can handle it.";
exit(1);

So the proper fix for the second issue is probably just checking if Runner::runner_id is a valid thread (i.e. has been created).
But on that notice, why bother using pthread directly and not std::thread?
If it's because an std::thread on the stack automatically starts a thread, just wrap it inside a std::unique_ptr.
A check using std::unique_ptr::operator bool then is a very convenient method to check if there is a thread possibly running.
Also, you don't have to take care of cleaning up after the thread since std::unique_ptr does that for you.
But that's just an idea.
I suppose you had a valid reason to use pthread directly.

[REQUEST] Add Cmake support

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
There are many benefits from using Cmake. Check out the documentation. Biggest one is portability. On platforms where Make isn't available, Cmake can still be made use of.
Describe the solution you'd like
A clear and concise description of what you want to happen.
I'd like to see this project built with llvm, which requires Cmake support. Compiler optimizations are much better using llvm.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Do nothing.
Additional context
Add any other context or screenshots about the feature request here.

Graphical issue whtn high number of cores

When the number of CPU cores/threads is high (>99), there are two graphical issues:

  • cores above 99 are shown as 10, 11 instead of 100, 110, etc.
  • when the terminal window is not full screen (e.g., when is resized to occupy only half of the screen), the CPU usage graph overlap with the list of processes.

Screenshots
image
image

EDIT: The same happen with CPU and NET graphs
image

[BUG] Help/docs reference to non-existence --utf-foce option

Describe the bug

The documentation (README.md) and --help output both reference an option --utf-foce ("force start even if no UTF-8 locale was detected").

But this option doesn't exist. The actual option is --utf-force.

To Reproduce

Run btop --utf-foce and notice you get

kde@midna ~/tmp/btop $ btop --utf-foce
 Unknown argument: --utf-foce
 Use -h or --help for help.

Expected behavior

I expected btop to start up without issue (as it did when using --utf-force). I didn't not test on a non-UTF-8 locale yet but I would expect the option to work even in that case.

Info (please complete the following information):

  • btop++ version: btop version: 1.0.0 (PS recommend adjusting the template here to read btop -v not bpytop -v)
  • Architecture: x86_64
  • Platform: Linux
  • (Linux) Kernel: 5.14.0
  • Terminal used: Konsole 21.11.70
  • Font used: JetBrains Mono

Additional context

Let me know if you actually need this

[possible BUG] - install location on centos

Describe the bug

The installer script installs btop++ to /usr/local/bin/btop. On Centos this does not appear to be in path for 7 and 8. When I symlink it to /usr/local/sbin/btop it is found and executed.

Expected behavior

as btop runs with super user requirements will it not make sense to install it to /usr/local/sbin/ instead?

[BUG] renders incorrectly in emacs vterm

Describe the bug

displays incorrectly (see screenshots)

To Reproduce

  1. install emacs 27
  2. install vterm, the way I'm doing it is with doom
git clone --depth 1 https://github.com/hlissner/doom-emacs ~/.emacs.d
~/.emacs.d/bin/doom install
# open ~/.doom.d/init.el, uncomment line with `vterm` by deleting leading semicolons
~/.emacs.d/bin/doom sync
  1. open emacs
  2. run vterm - either with Meta-x shortcut and search for "+vterm/here", or, press [Space o t]
  3. run btop

Expected behavior

render similarly to bpytop

Screenshots

btop

image
image
image

bpytop

image
image

Info (please complete the following information):

Additional context

❯ cat ~/.config/btop/btop.log 

2021/10/02 (12:42:00) | ===> btop++ v.1.0.12
2021/10/02 (12:42:00) | DEBUG: Starting in DEBUG mode!
2021/10/02 (12:42:00) | INFO: Logger set to DEBUG
2021/10/02 (12:42:00) | DEBUG: Using locale en_US.UTF-8
2021/10/02 (12:42:00) | INFO: Running on /dev/pts/1
2021/10/02 (12:42:00) | INFO: Forcing tty mode: setting 16 color mode and using tty friendly graph symbols
2021/10/02 (12:42:06) | INFO: Quitting! Runtime: 00:00:06

I also tried flipping all setting in general tab, but it didn't help

[BUG] Crashes on startup (on kitty and alacritty)

Describe the bug
Tried to run on pop OS 21.04. Crashes on startup with the following log:

/usr/include/c++/11/ranges:540: constexpr std::ranges::iota_view<_Winc, _Bound>::iota_view(std::type_identity_t<_Winc>, st
  3 d::type_identity_t<_Bound>) [with _Winc = int; _Bound = int; std::type_identity_t<_Winc> = int; std::type_identity_t<_Boun
  2 d> = int]: Assertion 'bool(__value <= __bound)' failed.                                                                   
  1 fish: “btop” terminated by signal SIGABRT (Abort)

It seems that it doesn't like the kitty terminal, but sometimes it seemed random. Unfortunately I wasn't taking note of everything before but I think it happens on kitty but not eg. on gnome terminal.

To Reproduce
Run the executable on the kitty terminal.

Info (please complete the following information):

  • btop++ version: 1.0.2
  • Architecture: x86_64
  • Platform: Linux
  • (Linux) Kernel: 5.11.0-7620-generic
  • Terminal used: kitty
  • Font used: Victor Mono

Additional context

contents of ~/.config/btop/btop.log

(try running btop with --debug flag if error.log is empty)

2021/09/20 (19:15:41) | ===> btop++ v.1.0.2
2021/09/20 (19:15:41) | DEBUG: Starting in DEBUG mode!
2021/09/20 (19:15:41) | INFO: Logger set to DEBUG
2021/09/20 (19:15:41) | DEBUG: Setting LC_ALL=en_US.UTF-8
2021/09/20 (19:15:41) | INFO: Running on /dev/pts/1

[REQUEST] Vim keys already included?

I know you already added hjkl navigation to bpytop. Is it missing or am i just too stupid to find out how to configure?

As an idea you may be able to get away with less requests like these if users could add their keybindings to the config file. Not sure how much time would go into implementing that but just a suggestion.

Have to say that i really like this version. As much as i love python this kind of thing is better written in a lower level language.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.