mirror of
https://github.com/XuehaiPan/nvitop.git
synced 2026-10-23 08:07:34 -06:00
[PR #233] feat(tui): add keybinding g to swap host and GPU history graphs #232
Labels
No labels
api
bug
bug
cli / tui
dependencies
documentation
documentation
documentation
duplicate
enhancement
exporter
invalid
pull-request
pynvml
question
question
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github-starred/nvitop#232
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/XuehaiPan/nvitop/pull/233
Author: @MengmaoR
Created: 10/22/2026
Status: 🔄 Open
Base:
main← Head:feat/swap-host-gpu-graphs📝 Commits (1)
9ec0372feat(tui): add keybindinggto swap host and GPU history graphs📊 Changes
3 files changed (+101 additions, -50 deletions)
View changed files
📝
nvitop/tui/screens/help.py(+10 -8)📝
nvitop/tui/screens/main/__init__.py(+4 -0)📝
nvitop/tui/screens/main/panels/host.py(+87 -42)📄 Description
Issue Type
Description
Add a reversible keybinding
gon the main screen to swap the horizontal positions of the host (CPU / MEM / SWP) and GPU (MEM / UTL) history graphs inHostPanel:swap_graphs=False): Host CPU/MEM/SWP graphs are rendered in the left 77-column pane (x + 1), and GPU memory/utilization graphs are rendered in the right pane (x + 79) when terminal width>= 100.swap_graphs=True, toggled viag): GPU memory/utilization graphs are rendered in the left 77-column pane, and Host CPU/MEM/SWP graphs are moved to the right pane when terminal width>= 100. Pressinggagain restores the default layout.100 <= width < 113): When host graphs are placed in the right pane and its inner width is narrower than the fullLoad AverageorMEM/SWPbyte labels, the labels gracefully fall back to compact percentage strings so they never overflow the right border.g: swap host/GPU graphsinHelpScreen.Motivation and Context
In
HostPanel, the left 79-column box is fixed to host CPU/memory/swap history graphs while GPU memory and utilization history graphs are only drawn on the right when the terminal width is at least 100 columns.When working in narrower terminals (
79 <= width < 100, such as split panes or side-by-side terminal windows), the GPU history graphs are completely hidden and only the host CPU/memory graphs are visible. Even on wider terminals, users primarily monitoring GPU workloads may prefer having the wider 77-column history window dedicated to GPU metrics.Adding the reversible
gshortcut lets users freely toggle between host and GPU history graphs in 79–99 column terminals and swap their left/right placement in 100+ column terminals, without altering the 79-column frame grid, border connectors (╧/╪), or timebase ruler.Testing
ruff check,ruff format --check,codespell,mypy, andpylint(10.00/10).g) and terminal resizing across narrow (80columns), medium (100–112columns), and wide (120+columns) PTY sessions, as well asHelpScreenrendering (h/?).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.