A unified terminal-based system monitor combining htop (system RAM/CPU) and nvidia-smi (GPU/VRAM) functionality into a single dashboard.
Originally created to solve the problem of monitoring CPU/system RAM/swap and GPU/VRAM usage from one window while testing local AI models on an RTX 3090/24GB, now running on RTX A6000/48GB.
- System Memory: One stacked RAM bar with non-overlapping Used / Cache / Free segments (GB legend inline), so the ~90 GB hiding in buffers/file-cache is visible; Total + the kernel's Available shown separately, plus a swap bar
- CPU Usage: Overall and per-core real-time utilization — cores pack into 1–8 columns sized by width AND height so every core stays visible (verified on a 2-socket 80-thread box)
- CPU Temperature: Package temperature (°C) via psutil sensor detection
- NVIDIA GPU Monitoring: VRAM usage, GPU utilization, temperature, power draw
- GPU Process Tracking: Top 5 active GPU compute processes (nvtop-style)
- Shows PID, user, GPU memory, host memory, and command
- Sorted by VRAM usage (descending)
- Color-coded progress bars: Visual feedback for resource usage
- Fully responsive layout: Reflows to any terminal size (nvtop-style) — resize freely, content never wraps or overwrites itself. Degrades gracefully from ultra-wide down to ~28 columns; on short terminals the GPU process table and VRAM bars are space-reserved and the CPU core rows absorb the squeeze
- Auto-refresh: Updates every second by default — configurable at launch (
-i/--interval SECONDS, 0.5–60) or interactively withr - Native C port (Linux + macOS): small ELF/Mach-O binary against
ncurses— no Python runtime needed. On Linux, verified to render byte-identical to the Python reference - Python reference:
termmon.pystays in-tree as the golden reference renderer
gcc(or any C11 compiler) with ncurses (pkg-configlocatesncursesw, falling back toncurses)- Linux: NVIDIA drivers with
nvidia-smi(for GPU monitoring) - macOS:
macmon(recommended) orpowermetricsfor GPU utilization/power
- Python 3.9+
psutil(pip3 install psutil)- Linux: NVIDIA drivers with
nvidia-smi(for GPU monitoring)
macmon— required for accurate GPU utilization/power without sudo- Install:
cargo install macmon(requires Rust toolchain) - Or build from source:
git clone https://github.com/vladkens/macmon && cd macmon && cargo build --release - Place binary in your
PATH(e.g.,cp target/release/macmon ~/bin/)
- Install:
- Fallbacks (if
macmonunavailable):socpwrbud(no sudo, archived) orpowermetrics(requires sudo on macOS 13+)
cd ~/dev/termmon
# Build the native C port (Linux + macOS)
make # -> ./termmon
# Install to ~/bin (backs up any previous ~/bin/termmon as termmon.py.bak)
make install # -> ~/bin/termmon
termmon# Or run the Python reference directly
python3 termmon.pySimply run termmon and watch your system resources in real-time.
-i SECONDS,--interval SECONDS,--interval=SECONDS— auto-refresh cadence in seconds, clamped to 0.5–60 (default 1). Example:termmon -i 3refreshes every 3 seconds; the footer shows the active cadence.-h,--help— usage
q- Quitr- Cycle the refresh cadence: 0.5→1→2→5→10→30→60→0.5s (footer updates immediately)h- Show help←/→- Horizontally scroll the GPU process Command column
Auto-refresh: Every 1 second (no action needed)
The layout is fully responsive — it reflows to whatever size your terminal is, nvtop-style. All four mockups below are real rendered output.
At 80 columns, the RAM bar is stacked (Used/Cache/Free) with the legend inline, cores run in two columns, and Util/VRAM take their own rows:
termmon 1.26.0 - System Monitor | 14:32:07 | q:quit r:rate h:help
┌────────────────────────────────────────────────────────────────────────────┐
│ SYSTEM MEMORY │
│────────────────────────────────────────────────────────────────────────────│
│ Mem: ███████████████████ Used: 12.5 GB | Cache: 2.4 GB | Free: 0.5 GB │
│ Total: 15.4 GB | Available: 2.9 GB │
│ Swap:████████████░░░░░░░░ 2.7/ 4.3GB 62.5% │
└────────────────────────────────────────────────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────────┐
│ CPU: 16 Cores | Usage: 23.4% | Temp: 46°C │
│────────────────────────────────────────────────────────────────────────────│
│ Core 0: ░░░░░░░░░░░░░░░░░░░░ 0.0% Core 8: ███████████░░░░░░░░░ 56.0% │
│ Core 1: █░░░░░░░░░░░░░░░░░░░ 7.0% Core 9: ████████████░░░░░░░░ 63.0% │
│ Core 2: ██░░░░░░░░░░░░░░░░░░ 14.0% Core 10: ██████████████░░░░░░ 70.0% │
│ Core 3: ████░░░░░░░░░░░░░░░░ 21.0% Core 11: ███████████████░░░░░ 77.0% │
│ Core 4: █████░░░░░░░░░░░░░░░ 28.0% Core 12: ████████████████░░░░ 84.0% │
│ Core 5: ███████░░░░░░░░░░░░░ 35.0% Core 13: ██████████████████░░ 91.0% │
│ Core 6: ████████░░░░░░░░░░░░ 42.0% Core 14: ███████████████████░ 98.0% │
│ Core 7: █████████░░░░░░░░░░░ 49.0% Core 15: █░░░░░░░░░░░░░░░░░░░ 5.0% │
└────────────────────────────────────────────────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────────┐
│ GPUs │
│────────────────────────────────────────────────────────────────────────────│
│ GPU 0: NVIDIA RTX A6000 | Util: 80.0% | Temp: 59°C | Power: 110.0W │
│ Util:████████████████░░░░ 80.0% │
│ VRAM:█████████████████░░░ 42.8GB/48.0G 89.1% │
└────────────────────────────────────────────────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────────┐
│ GPU PROCESSES ←/→ scroll 0 │
│────────────────────────────────────────────────────────────────────────────│
│ PID USER DEV TYPE GPU GPU MEM CPU HOST MEM Command │
│────────────────────────────────────────────────────────────────────────────│
│ 54321 iforevan 0 C -- 39506M 12.0% 7768M llama-server --ho │
└────────────────────────────────────────────────────────────────────────────┘
Refresh: 1s | q:quit r:rate h:help ←/→:process scroll
Shrink to 50 columns and the box narrows with the terminal, bars shorten, the GPU title drops segments, and the footer compacts — no wrapping, no overwritten content:
termmon 1.26.0 | 14:32:07
┌──────────────────────────────────────────────┐
│ SYSTEM MEMORY │
│──────────────────────────────────────────────│
│ Mem: █████████████ U 12.5 | C 2.4 | F 0.5G │
│ Total: 15.4 GB | Available: 2.9 GB │
│ Swap:███████████░░░░░░░░ 2.7/ 4.3GB 62.5% │
└──────────────────────────────────────────────┘
┌──────────────────────────────────────────────┐
│ CPU: 16 Cores | Usage: 23.4% | Temp: 46°C │
│──────────────────────────────────────────────│
│ Core 0: ░░░░░ 0.0% Core 8: ██░░░ 56.0% │
│ Core 1: █░░░░ 7.0% Core 9: ███░░ 63.0% │
│ Core 2: █░░░░ 14.0% Core 10: ███░░ 70.0% │
│ Core 3: █░░░░ 21.0% Core 11: ███░░ 77.0% │
│ Core 4: █░░░░ 28.0% Core 12: ████░ 84.0% │
│ Core 5: █░░░░ 35.0% Core 13: ████░ 91.0% │
│ Core 6: ██░░░ 42.0% Core 14: ████░ 98.0% │
│ Core 7: ██░░░ 49.0% Core 15: █░░░░ 5.0% │
└──────────────────────────────────────────────┘
┌──────────────────────────────────────────────┐
│ GPUs │
│──────────────────────────────────────────────│
│ GPU 0: NVIDIA RTX A6000 | Util: 80.0% │
│ Util:████████████████░░░░ 80.0% │
│ VRAM:███████████████░░ 42.8GB/48.0G 89.1% │
└──────────────────────────────────────────────┘
┌──────────────────────────────────────────────┐
│ GPU PROCESSES ←/→ scroll 0 │
│──────────────────────────────────────────────│
│ PID USER DEV TYPE GPU GPU MEM C│
│──────────────────────────────────────────────│
│ 54321 iforevan 0 C -- 39506M 12 │
└──────────────────────────────────────────────┘
q:quit r:rate h:help ←/→:scroll
On short terminals (Termius on an iPad, 34 rows here) the blank rows between sections disappear and the cores pack into three narrower columns, so every core stays visible while the GPU process table keeps its space:
termmon 1.26.0 - System Monitor | 14:32:07 | q:quit r:rate h:help
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ SYSTEM MEMORY │
│──────────────────────────────────────────────────────────────────────────────────────────────────────────│
│ Mem: ████████████████████ Used: 12.5 GB | Cache: 2.4 GB | Free: 0.5 GB │
│ Total: 15.4 GB | Available: 2.9 GB │
│ Swap:████████████░░░░░░░░ 2.7/ 4.3GB 62.5% │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ CPU: 16 Cores | Usage: 23.4% | Temp: 46°C │
│──────────────────────────────────────────────────────────────────────────────────────────────────────────│
│ Core 0: ░░░░░░░░░░░░░░░░░ 0.0% Core 6: ███████░░░░░░░░░░ 42.0% Core 12: ███████████████░░░ 84.0% │
│ Core 1: █░░░░░░░░░░░░░░░░ 7.0% Core 7: ████████░░░░░░░░░ 49.0% Core 13: ████████████████░░ 91.0% │
│ Core 2: ██░░░░░░░░░░░░░░░ 14.0% Core 8: █████████░░░░░░░░ 56.0% Core 14: █████████████████░ 98.0% │
│ Core 3: ███░░░░░░░░░░░░░░ 21.0% Core 9: ██████████░░░░░░░ 63.0% Core 15: █░░░░░░░░░░░░░░░░░ 5.0% │
│ Core 4: ████░░░░░░░░░░░░░ 28.0% Core 10: ███████████░░░░░░ 70.0% │
│ Core 5: █████░░░░░░░░░░░░ 35.0% Core 11: █████████████░░░░ 77.0% │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ GPUs │
│──────────────────────────────────────────────────────────────────────────────────────────────────────────│
│ GPU 0: NVIDIA RTX A6000 | Util: 80.0% | Temp: 59°C | Power: 110.0W │
│ Util:████████████████░░░░ 80.0% VRAM:█████████████████░░░ 42.8GB/48.0G 89.1% │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ GPU PROCESSES ←/→ scroll 0 │
│──────────────────────────────────────────────────────────────────────────────────────────────────────────│
│ PID USER DEV TYPE GPU GPU MEM CPU HOST MEM Command │
│──────────────────────────────────────────────────────────────────────────────────────────────────────────│
│ 54321 iforevan 0 C -- 39506M 12.0% 7768M llama-server --host 127.0.0.1 --port 8080 -c 16 │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Refresh: 1s | q:quit r:rate h:help ←/→:process scroll
On a many-thread machine — here 2 sockets × 20 cores / 40 threads = 80 logical CPUs at 120 columns — the cores pack into as many columns as fit (five here), so every thread stays visible instead of tails of columns going missing:
termmon 1.26.0 - System Monitor | 14:32:07 | q:quit r:rate h:help
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ SYSTEM MEMORY │
│────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
│ Mem: ████████████████████ Used: 12.5 GB | Cache: 2.4 GB | Free: 0.5 GB │
│ Total: 15.4 GB | Available: 2.9 GB │
│ Swap:████████████░░░░░░░░ 2.7/ 4.3GB 62.5% │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ CPU: 80 Cores | Usage: 23.4% | Temp: 46°C │
│────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
│ Core 0: ░░░░░ 0.0% Core 16: █░░░░ 12.0% Core 32: █░░░░ 24.0% Core 48: █░░░░ 36.0% Core 64: ██░░░░ 48.0% │
│ Core 1: █░░░░ 7.0% Core 17: █░░░░ 19.0% Core 33: █░░░░ 31.0% Core 49: ██░░░ 43.0% Core 65: ███░░░ 55.0% │
│ Core 2: █░░░░ 14.0% Core 18: █░░░░ 26.0% Core 34: █░░░░ 38.0% Core 50: ██░░░ 50.0% Core 66: ███░░░ 62.0% │
│ Core 3: █░░░░ 21.0% Core 19: █░░░░ 33.0% Core 35: ██░░░ 45.0% Core 51: ██░░░ 57.0% Core 67: ████░░ 69.0% │
│ Core 4: █░░░░ 28.0% Core 20: ██░░░ 40.0% Core 36: ██░░░ 52.0% Core 52: ███░░ 64.0% Core 68: ████░░ 76.0% │
│ Core 5: █░░░░ 35.0% Core 21: ██░░░ 47.0% Core 37: ██░░░ 59.0% Core 53: ███░░ 71.0% Core 69: ████░░ 83.0% │
│ Core 6: ██░░░ 42.0% Core 22: ██░░░ 54.0% Core 38: ███░░ 66.0% Core 54: ███░░ 78.0% Core 70: █████░ 90.0% │
│ Core 7: ██░░░ 49.0% Core 23: ███░░ 61.0% Core 39: ███░░ 73.0% Core 55: ████░ 85.0% Core 71: █████░ 97.0% │
│ Core 8: ██░░░ 56.0% Core 24: ███░░ 68.0% Core 40: ████░ 80.0% Core 56: ████░ 92.0% Core 72: █░░░░░ 4.0% │
│ Core 9: ███░░ 63.0% Core 25: ███░░ 75.0% Core 41: ████░ 87.0% Core 57: ████░ 99.0% Core 73: █░░░░░ 11.0% │
│ Core 10: ███░░ 70.0% Core 26: ████░ 82.0% Core 42: ████░ 94.0% Core 58: █░░░░ 6.0% Core 74: █░░░░░ 18.0% │
│ Core 11: ███░░ 77.0% Core 27: ████░ 89.0% Core 43: █░░░░ 1.0% Core 59: █░░░░ 13.0% Core 75: █░░░░░ 25.0% │
│ Core 12: ████░ 84.0% Core 28: ████░ 96.0% Core 44: █░░░░ 8.0% Core 60: █░░░░ 20.0% Core 76: █░░░░░ 32.0% │
│ Core 13: ████░ 91.0% Core 29: █░░░░ 3.0% Core 45: █░░░░ 15.0% Core 61: █░░░░ 27.0% Core 77: ██░░░░ 39.0% │
│ Core 14: ████░ 98.0% Core 30: █░░░░ 10.0% Core 46: █░░░░ 22.0% Core 62: █░░░░ 34.0% Core 78: ██░░░░ 46.0% │
│ Core 15: █░░░░ 5.0% Core 31: █░░░░ 17.0% Core 47: █░░░░ 29.0% Core 63: ██░░░ 41.0% Core 79: ███░░░ 53.0% │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ GPUs │
│────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
│ GPU 0: NVIDIA RTX A6000 | Util: 80.0% | Temp: 59°C | Power: 110.0W │
│ Util:████████████████░░░░ 80.0% VRAM:█████████████████░░░ 42.8GB/48.0G 89.1% │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ GPU PROCESSES ←/→ scroll 0 │
│────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
│ PID USER DEV TYPE GPU GPU MEM CPU HOST MEM Command │
│────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
│ 54321 iforevan 0 C -- 39506M 12.0% 7768M llama-server --host 127.0.0.1 --port 8080 -c 163840 -ngl │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Refresh: 1s | q:quit r:rate h:help ←/→:process scroll
Below ~24 columns termmon shows a "Terminal too small" notice rather than rendering a mangled dashboard.
- 🟢 Green: Used RAM (stacked bar segment) / system memory
- 🔵 Cyan: RAM held as Cache (buffers + page cache + reclaimable slab; includes tmpfs/shared pages, so not fully reclaimable) / CPU usage
- ⚪ White: Free RAM (stacked bar segment)
- 🟡 Yellow: Swap usage
- 🟣 Magenta: VRAM usage
- 🔴 Red: Error messages
- Monitor VRAM usage while running llama.cpp, text-generation-webui, etc.
- Track GPU utilization during inference
- Watch power draw and temperature for thermal management
- See which processes are using GPU memory
- Quick overview of system health
- Identify memory pressure or swap usage
- Monitor per-core CPU load for debugging
- Keep an eye on resources while building/training models
- Single-window monitoring (no more multiple terminals!)
- Built with: C + ncursesw (native Linux port,
src/); the Python reference uses curses + psutil (termmon.py) - Dependencies: C build: a C11 compiler + ncursesw (auto-detected via
pkg-config); Python reference:psutil - Golden reference testing: the C renderer is verified byte-identical to the Python renderer on frozen data (
tests/test_golden.py) - Platform detection: Auto-detects Linux (NVIDIA) or macOS (Apple Silicon) — the C port runs natively on both; the Python reference stays as the golden oracle
- GPU Detection:
nvidia-smion Linux;macmon(preferred) orpowermetricson macOS, GPU model/core count viahw.gpu.modelorsystem_profiler - macOS GPU: Two-tier fallback —
macmon(actively maintained, no sudo),powermetrics(requires sudo on macOS 13+); UMA-aware rendering (core count + "shared w/ system memory" instead of a VRAM bar) - CPU Stats: Linux reads per-core deltas from
/proc/stat; macOS useshost_processor_infotick deltas; Python uses psutil (cross-platform) - Memory Stats: Linux reads
/proc/meminfodirectly —Cache = Buffers + Cached + SReclaimable,Used = Total − Free − Cache(so Used + Cache + Free == Total);MemAvailableis shown beside the bar, never as a segment. macOS readshw.memsize+host_statistics64—Used = active + wired,Free = free_count, cache absorbs the remainder (mirrors psutil's macOS accounting, verified against it). Other platforms use psutil (its Linux.cachedalready folds in SReclaimable, so mixing both would double-count) - Process Info: Linux parses
/proc/[pid]/{stat,status,cmdline}with jiffies-delta CPU%; macOS useslibproc/proc_pidinfowith mach-tick delta CPU% (top-N by host RSS as the UMA proxy for GPU activity); Python uses psutil.Process() - Refresh Rate: 1 second by default — launch with
-i/--interval SECONDS(0.5–60), or cycle presets (0.5/1/2/5/10/30/60s) live with therkey - Layout: Adaptive box width (
min(120, terminal_width - 2)), computed bar widths, and per-section two-column/single-column breakpoints. The per-core grid packs into 1–8 columns chosen from both width and height (fullCore 79:cells, then bare-label slim cells, then integer-percentage cells as a last resort) so no core is ever hidden when the grid outgrows the height budget. All drawing goes through a single bounds-clipping_safe_addstr()helper - Resize handling:
SIGWINCHtriggers a kernelTIOCGWINSZquery (not the stale cursesgetmaxyx()cache), thenresizeterm()+clear()
One command runs everything:
make testWhich covers four harnesses; all must be clean after any change to the draw path.
# C unit tests — pure layout math (bar widths, largest-remainder stacking,
# UTF-8 clipping, process-table geometry): tests/test_layout.c
./tests/test_layout
# Golden screen diff — C port vs Python oracle on identical frozen data
# (9 dashboard sizes 28–120 cols + 5 help-popup sizes, byte-identical)
python3 tests/test_golden.py
# MockStdscr sweep — 2,820 configs (widths 20-160 x 5 heights x NVIDIA/UMA x 2 scroll offsets)
python3 tests/test_responsive_layout.py
# Stacked Used/Cache/Free accounting, largest-remainder rounding, live meminfo
python3 tests/test_mem_stacking.py
# Real PTY + curses, parsed with pyte — 9 static sizes and 5 live SIGWINCH
# resizes; drives the Python oracle by default or any binary via --bin
python3 tests/test_pty_layout.py # requires: pip3 install pyte
python3 tests/test_pty_layout.py --bin ./termmon # the C port, live data
python3 tests/test_pty_layout.py --show 80The C golden harness feeds both renderers the same fixture (TERMMON_FIXTURE=…) and diffs the pyte-parsed screen row-for-row — the strongest guarantee the port is behaviourally identical. The mock suite asserts no write lands outside the terminal grid and that box edges stay consistent. The PTY suite is the one that catches resize bugs — a mock harness never fires SIGWINCH, so it cannot detect stale curses geometry.
- No more invisible cores on many-thread machines: the per-core grid splits cores column-major (column c holds cores
[c*rows, (c+1)*rows)), so when the height budget ran out mid-grid it silently hid one tail slice per column — on a new 2-socket box (80 threads) the 3-column mode dropped cores 17–26, 44–53 and 71–79 entirely. Column count is now chosen from both dimensions by a pure helper (cpu_core_columns()in layout.c, mirrored in the Python oracle): start from what the width allows, then add columns while the rows don't fit the height budget and another cell still fits — full cells first ("Core 79:" + ≥5-block bar + decimal %), then slim cells (bare "79:" label), then last-resort cells with an integer percentage (the existing per-cell degrade ladder already trimmed labels/percentages within a cell; the column count now follows the same tiers). Ladder generalized 1/2/3 → 1–8 columns; wide roomy terminals still render 2 columns with 20-block bars exactly as before. Verified live on the 80-thread / 2×A6000 machine: 132×44 shows all 80 cores; the old layout showed 39. Golden C-vs-Python byte-identical at all nine sizes plus new 80-core parity checks (9 sizes); new unit tests cover the tier math.
- Dead code and stale docs removed (code-review follow-up): the C main loop's vestigial refresh-interval block is gone — cadence lives in the collector thread, and the block only re-stamped a timestamp nothing read; the Python reference lost its unreachable
gpu_pctbranch (the process table's GPU column is always--, matching the C port) plus four stale docstrings (2s refresh, 0.2s clamp floor, "Force refresh"). No behavior change. - Python thread hygiene:
get_gpu_stats/get_gpu_processesand their per-backend helpers no longer assignself.gpu_data/self.gpu_processesfrom executor threads — they return lists, and the updater thread publishes them in the single_stats_lock-protected swap, so the lock now genuinely guards what its docstring claims. No behavior change: golden + PTY suites byte-identical, verified end-to-end with livenvidia-smidata through the new path.
- Bounded shutdown in the C port: quitting (
q/Ctrl+C) while the collector was parked inside annvidia-smipoll deadline blockedstats_stop'spthread_joinfor the full deadline — two sequential 5s queries meant up to ~10s of frozen screen on systems with a slow or hung driver. Shutdown now mirrors the Python reference'sjoin(timeout=2): ag_stoppingflag stopsrun_cmd_capturefrom spawning anything new, the in-flight child is exposed viag_child_pidand SIGKILLed after a 200ms grace, and the worker signals afinishedflag on a condvar so the join wait is event-driven (200ms + 2s bound, detach as last resort). Measured with a deliberately hungnvidia-smi: 9.1s → 0.22s to exit afterq; the normal path is 20ms. make testruns everything: the target silently omittedtests/test_responsive_layout.py(2,820-config mock sweep) andtests/test_mem_stacking.pyeven though the README claimed one command covers all harnesses. Both are wired in now; all six harnesses green.- Python reference:
curses.noecho(): the C port always callednoecho(); the Python reference never did, so ncurses transiently echoed typed keys at the cursor between frames (invisible to the golden tests, which snapshot after full redraws). One line inrun(), restoring strict C-vs-Python behavioural parity.
- Short terminals: no wasted rows, three-column CPU: the v1.24.x fixes kept the process table alive on a Termius/iPad screen but paid for it with core rows clipped (6 of 16 visible at 110×38) while blank separator rows between the boxes went unused. Two changes, identical in both implementations: (1) the one blank row between sections is dropped when the terminal is too short to show everything comfortably, and the three reclaimed rows go back into the CPU/GPU budgets — at 110×38 every core is visible again; (2) when the two-column core rows still don't fit the height left for the CPU box, cores pack into three narrower columns (gauges shorten to match), so 16 cores need 6 rows instead of 8. The compact/3-column modes trigger only under height pressure — roomy terminals render exactly as before. Golden C-vs-Python byte-identical at all nine test sizes; verified in real PTYs at 26/30/34/38 rows.
- Process table no longer starved on short terminals: with the footer visible but the GPU-process rows gone (Termius on iPad at ~38 rows), the cause was vertical-space starvation, not size detection — the CPU core rows and GPU bars draw first and consumed every line, and the process section's
height - 3guards then silently dropped its rows down to just the header. The frame now budgets bottom-up: the process table reserves its minimum viable height (chrome + up to 3 rows + footers) and the GPU section reserves enough to show every GPU in full; the CPU core rows — the most expendable content — absorb the squeeze first. GPU and process sections may now draw down toheight - 2(the app footer needs only the last row, not three). Verified in real PTYs at 26/30/34/38 rows: process rows render at every height; golden C-vs-Python still byte-identical.
- Self-heal missed
SIGWINCH(Termius/iPad bottom cut-off): mobile terminals sometimes change the PTY geometry without deliveringSIGWINCHto the app — toggling the on-screen keyboard, backgrounding/foregrounding, rotating — leaving termmon laying out for a stale, taller screen so the bottom rows (GPU processes table, footer) fell below the visible viewport. Both implementations now pollTIOCGWINSZevery frame (one cheap ioctl) and re-sync curses only when the size actually differs; the signal handler is kept to wake input and force an immediate redraw. New PTY regression test blocksSIGWINCHin the child before exec, resizes, and asserts the screen re-lays out (footer pinned to the new last row) — passes for both the C binary and the Python reference.
- Memory labels: GiB → GB: the stacked-RAM legend (
Used: … GB | Cache: … GB | Free: … GB) and theTotal: … GB | Available: … GBrow now read GB, matching the dashboard's existing GB convention (VRAM/swap already display GB). Labels only — the underlying values are unchanged binary quantities (KiB/1024²). Identical in both implementations; golden tests confirm C and Python still render byte-for-byte the same.
- Native macOS (Apple Silicon) support in the C port:
collect.cnow compiles and runs on Darwin — the binary is no longer Linux-only. System stats: CPU% fromhost_processor_infoper-core tick deltas; memory/swap fromhw.memsize+host_statistics64+vm.swapusage, mirroring psutil's macOS accounting (Used = active + wired,Free = free_count, cache absorbs the remainder so Used + Cache + Free == Total; values converted bytes→GiB, verified against psutil live). Apple GPU: two-tiermacmon→powermetricsfor util/power/temp, GPU model viahw.gpu.modelwith one-shotsystem_profilerfallback for the chip name + core count (spdisplays_chipset/sppci_cores), one-shot JSON extractors (no parser dependency). GPU processes: top-N by host RSS (UMA proxy, no privileged per-process VRAM query), user/name viaproc_pidinfo(PROC_PIDTASKALLINFO), args viaKERN_PROCARGS2, CPU% via mach-tick deltas seeded across samples. UMA-aware rendering:Apple GPU (N-core GPU)title, "UMA: shared w/ system memory" in place of the VRAM bar,gpu_backend_apple()drives the section title and no-data message. NVIDIA//procpaths untouched behind#if !defined(__APPLE__); golden tests still exercise the Linux path. Verified live on M-series: memory matches psutil, macmon reads flow in,mlx-servelisted with user/host-mem/CPU%.
- Interactive cadence control: the
rkey now cycles the refresh interval through presets 0.5→1→2→5→10→30→60→0.5s instead of forcing a single refresh; the footer shows the active cadence immediately (it already rendered the live interval). The pure ladder (next_refresh_interval) is unit-tested; golden tests pressrin real PTYs and assert C and Python footers step identically (1 press → 2s, 2 → 5s, full loop back). Title/footer hints renamedr:refresh→r:rate; help popup line is nowr - Cycle refresh rate. Forcing an immediate collection still happens on everyrpress (and at each new cadence); CLI-iremains for a fixed non-default start. - Cadence floor raised 0.2s → 0.5s: the minimum for
-i/--interval(and the lowest r-cycle preset) is now 0.5s — half a second is the fastest sensible cadence for an nvidia-smi-backed dashboard.
- Configurable refresh cadence:
termmon -i SECONDS/--interval SECONDS/--interval=SECONDSsets the auto-refresh interval (clamped to 0.2–60, default 1s). Implemented identically in both: the C port parses argv before curses init (globalg_refresh_intervaldrives the main loop and the collector-thread throttle); the Python reference exposesapply_interval_args(). The footer renders the active cadence via%g/str-matching formatting (Refresh: 3s,Refresh: 2.5s).-h/--helpprints usage; invalid or unknown arguments exit non-zero with a message in both implementations. - New golden cases:
tests/test_golden.pydiffs both renderers' footers under seven interval settings (int, decimal,=form, both clamp bounds) and asserts C and Python reject invalid intervals identically;tests/test_layout.ccoversfmt_interval().
- Native C port (Linux): termmon is now a small C binary against
ncursesw(src/termmon.h,main.c,collect.c,layout.c,draw.c) — no Python runtime. Data collection reads/proc/statper-core deltas,/proc/meminfo, hwmon temps, and shells out tonvidia-smiwith a poll-based deadline; GPU-process enrichment parses/proc/[pid]directly. The Python implementation stays in-tree as the golden reference and the macOS path. - Byte-identical rendering (verified):
tests/test_golden.pydrives both renderers with identical frozen stats (TERMMON_FIXTURE) in real PTYs and diffs the pyte-parsed screen — all 9 dashboard sizes (28–120 cols) and 5 help-popup sizes (including the silently-skipped tiny case) match row-for-row. Layout math is unit-tested intests/test_layout.c. - 1s refresh cadence:
REFRESH_INTERVALhalved from 2s to 1s in both implementations (main loop, collector thread throttle, and footer text). - Fidelity fixes found by the golden gate:
wclear→werase(clear-on-redraw caused a 35x output storm vs the Python diff-updates), codepoint-exact UTF-8 clipping at the box's right edge, legend separator truncation,Refresh: 2sstring,Power: …Wspacing. - Build & install:
make(zero warnings under-Wall -Wextra),make installto~/bin/termmon(backs up the previous binary astermmon.py.bak),make uninstallrestores it.make testruns unit + golden + PTY suites against both implementations.
- Stacked Used/Cache/Free RAM bar: the single system-memory bar is now one stacked bar of three non-overlapping, colour-coded segments — 🟢 Used (green), 🔵 Cache (cyan), ⚪ Free (white) — with a colour-keyed legend giving each amount in GiB (inline beside the bar when it fits, otherwise on its own row), plus a
Total: … | Available: …row and the swap bar. The point: memory held for mmap/file caching is now visible. A llama-server host could previously headline ~18 GiB "used" while ~90 GiB sat in buffers/cache. - Accounting from
/proc/meminfodirectly (Linux):Total=MemTotal,Free=MemFree,Cache=Buffers+Cached+SReclaimable,Used=Total−Free−Cache(values in the file's "kB" label are KiB, 1024 bytes each), soUsed + Cache + Free == Totalexactly.Available=MemAvailableis the kernel's overlapping estimate — displayed separately, never a fourth segment;Total − Availableis deliberately not Used because it would overlap Cache. psutil is bypassed on Linux (itsvirtual_memory().cachedalready folds SReclaimable in — reusing it here would double-count); macOS/psutil fallback forces the same invariant with Cache as the remainder. Missing optional fields and transient/procread failures degrade to sane zeros/fallbacks instead of crashing the refresh loop; memory collection is isolated from swap/CPU collection. - Exact-fit segments: new
_stacked_segment_widths()uses largest-remainder (Hare quota) rounding so segment widths always sum to exactly the bar width — no gap, no overlap — at every terminal size. Legend/summary/swap rows degrade by width (four label templates) and by height (drop swap, then summary, then legend on very short terminals);MEM_TWO_COL_MINretired. New tests:tests/test_mem_stacking.py.
- Consistent GPU section header: the GPU section title is now a plain
GPUslabel (backend name when no data), matching the clean style of the other section titles. Per-GPU stats moved from the right-alignedTemp: ... Power: ...block onto each GPU's own detail line:GPU 0: NVIDIA RTX A6000 | Util: 80.0% | Temp: 59°C | Power: 110.0W, with segments dropped right-to-left (Power, then Temp) for narrow boxes. Cuts one row per GPU at narrow widths and removes the duplicated name between the title and the detail line. - Removed
GPU_HEADER_TWO_COL_MINbreakpoint: no longer needed now that temp/power live inline on the GPU detail line.
- CPU temperature monitoring: Added
_get_cpu_temp()which readspsutil.sensors_temperatures()and prefers thecoretempsensor (Intel package reading), falling back tocpu_thermal,k10temp,zenpower, then any available sensor group. Returns the max reading orNonewhen no sensor is available (most VMs, ARM Macs). Displayed in the CPU section title asCPU: 16 Cores | Usage: 0.8% | Temp: 47°C, with three-tier fallback for narrow terminals.
- GPU collection error logging:
_stats_updater_threadnow logs GPU data collection failures vialogger.error()instead of silently swallowing exceptions. Persistent nvidia-smi failures (driver crash, permission loss) are now visible in logs. - Removed dead startup CPU seed loop:
run()no longer iterates all system processes to seedcpu_percent. The targeted_seed_cpu_percent()calls inside_get_gpu_processes_nvidiaand_get_gpu_processes_applealready seed only the PIDs that appear in the GPU table, eliminating O(N) wasted psutil calls at startup.
- Help popup CPU spin fix:
_show_help()usednodelay(False)/nodelay(True)to toggle blocking input, butrun()sets up input viastdscr.timeout(50). Thenodelay(True)restore permanently overrode the 50ms timeout, so after dismissing the help popupgetch()returned -1 instantly every iteration, spinning the main loop at ~100% CPU. Replaced withtimeout(-1)(block) /timeout(50)(restore). Verified empirically: idle 2.0% → 99.5% before fix, 2.0% → 2.0% after. - DRY refresh interval: main loop's draw trigger used a hardcoded
2instead of theREFRESH_INTERVALconstant, so changing the constant would desync the main loop from the background thread.
- Clean terminal exit: Added
clearand cursor-visible escape (\033[?25h) aftercurses.endwin()so the screen is clean and the cursor is visible when termmon exits.
- Fully responsive layout: the dashboard now reflows to any terminal size instead of wrapping around and overwriting itself when the window is made narrower than the content (nvtop-style behaviour).
- Adaptive box width: replaced
max(80, min(120, width * 0.85))withmin(120, width - 2). The old 80-column floor meant that at 60 columns the app still drew an 80-wide box, and every write past the right edge wrapped onto the next line and clobbered it. The box now fills the terminal with a 1-char margin. _safe_addstr()bounds guard: every single write in the draw path goes through one clipping helper that respects both the terminal edge and the box's right border (max_x). Zero rawaddstrcalls remain outside the helper.- Adaptive bar widths:
_bar_width()sizes progress bars from the space actually available (measured overhead, not estimates), clamped to[5, 20], instead of a hardcodedBAR_WIDTH = 20. - Layout mode switching: Memory (Mem/Swap), CPU (per-core), and GPU (Util/VRAM, name/temp+power) each drop from two columns to stacked single-column rows at their own measured breakpoints. Info strings shorten progressively so values are never clipped mid-number.
- Removed hardcoded column offsets: the GPU section's
left_col_width = 43and the memory section's+ 16right-column offset are now computed from real content lengths. - True resize handling (the actual root cause): curses caches
LINES/COLSatinitscr(), sostdscr.getmaxyx()returns the old geometry right afterSIGWINCH— feeding it back intoresizeterm()was a no-op and the app kept rendering at the previous width._true_terminal_size()now queries the kernel viaTIOCGWINSZand_apply_resize()resizes then clears stale cells. - Graceful degradation: renders cleanly down to ~28 columns; below 24 shows a "Terminal too small" notice. The help popup shrinks to fit and drops lines rather than overflowing.
- Adaptive box width: replaced
- Test harnesses added:
tests/test_responsive_layout.py(MockStdscr, sweeps widths 20–160 × 5 heights × 2 GPU backends × 2 scroll offsets = 2,820 configs, asserts no out-of-bounds write and consistent box edges) andtests/test_pty_layout.py(real PTY +pyte, verifies actual curses output at 9 static sizes and 5 live resizes). Both pass with zero failures; the mock suite reports 2,592 failures against v1.15.0, confirming it detects the original bug.
- Fix GPU util sentinel:
_apple_gpu_util_*tiers now returnOptional[Tuple]—Nonemeans "tool unavailable",(0.0, 0.0)means "ran but GPU was genuinely idle". Old code used!= (0.0, 0.0)which skipped real idle readings. Addedtry/except ValueErroraround float parsing in powermetrics tier for malformed output.
- macOS GPU metadata consolidation: Merged
_apple_gpu_model()and_apple_gpu_cores()(which each ransystem_profiler) into a single cached_apple_gpu_metadataproperty with_detect_apple_gpu_metadata()helper. Reduces subprocess calls from 2 to 0 on repeated refreshes (cached after first call). - Process table header caching: Replaced per-draw
_gpu_process_fixed_header()method with static class constant_GPU_PROCESS_FIXED_HEADERand_GPU_PROCESS_FIXED_HEADER_LEN. Eliminates string construction + f-string parsing on every render frame. - Dead code removal: Removed
_gpu_process_table_row()method (unreachable — the scrolling draw path uses_draw_scrolled_process_lineinstead).
- macOS GPU core count fix:
_apple_gpu_cores()now parsessystem_profiler SPDisplaysDataType -json(sppci_cores) instead of the non-existenthw.gpussysctl. GPU core count was always 0 on Apple Silicon. - CPU percent enrichment fix:
psutil.Process.cpu_percent(interval=None)returns 0.0 on first call per Process object. Added_seed_cpu_percent(pids)that seeds all candidate PIDs before the enrichment pass, so CPU % columns show real values instead of 0.0% on every refresh. - Clean Ctrl+C exit: Added explicit
except KeyboardInterruptinrun()andcurses.curs_set(1)in cleanup to restore cursor visibility. - Persistent thread pool: Replaced per-refresh
ThreadPoolExecutorcreation with a persistentself._gpu_data_executorcreated in__init__and shut down on exit. Eliminates thread pool creation/destruction overhead every 2-second refresh cycle.
- cpu_percent seeding: All processes are seeded on startup so the first
cpu_percent(interval=None)read returns real values instead of 0 - Structured logging: Replaced swallowed exception in stats thread with
logging.error()— collection failures are now visible in logs - Consistent timing: Main loop switched from
time.time()totime.monotonic(), matching the background thread. Eliminates drift if the system clock jumps. - Cleaner startup: Removed redundant second event fire + dead sleep at startup. Single event + 0.5s sleep is sufficient.
- Startup tool detection: Replaced
subprocess.run(['which', ...])withshutil.which(), avoiding unnecessary process forks.
- Thread safety: eliminated race condition in draw()
draw()now takes a thread-safe snapshot under_stats_lockand passes it through_draw_frame→ all_draw_*methods as asnapshotdict- No instance attribute mutation during draw — the background thread and draw never touch the same objects concurrently
- Thread safety: eliminated global mutable
BOX_WIDTHBOX_WIDTHreplaced withself._box_width, computed once per frame in_draw_frameand passed asbwto all draw methods- No more
global BOX_WIDTH— all draw methods are now pure readers of their arguments
- Background thread auto-refresh
_stats_updater_threadnow drives itself on aREFRESH_INTERVALtimer viatime.monotonic()- Stats stay fresh even when the main loop is blocked (e.g., help popup
getch()) - The event still provides an immediate-trigger path (e.g.,
rkey, terminal resize)
- README display layout mockup updated: ASCII mockup now accurately reflects v1.10.0 UI
- Memory section shows Mem/Swap on same line (two-column layout)
- CPU cores show compact bar format matching actual rendering
- GPU section shows compact 2-row layout with Util+VRAM side-by-side
- GPU processes section shows ←/→ scroll indicator and correct column format
- Footer reverse-status bar added
- Hardware reference updated: RTX 3090/24GB → RTX A6000/48GB
- Bug fix: nvidia-smi CSV parsing: GPU names containing commas (e.g. "Tesla V100-SXM2, 32GB") no longer break the parser
- Now parses index from the left and 6 numeric fields from the right, treating everything in between as the name
- Threading improvement: replaced
_stats_should_updateboolean withthreading.Event()- Background thread blocks on
wait(timeout=0.1)instead of busy-polling — more efficient, race-free signaling
- Background thread blocks on
- Cleanup: removed dead
get_system_stats()method (~48 lines), unusedOptionalimport, unused color pairs (COLOR_ERROR,COLOR_PROCESS), redundant localimport pwd - UI consistency: memory section data rows now have the same 1-space padding as CPU/GPU sections
- Net result: 47 fewer lines, same functionality, fewer bugs
- Threading safety fix:
self._stats_locknow actually protects data access- Background thread collects stats into local vars, then swaps atomically under lock
draw()snapshots data under the lock before rendering — no more torn reads- Clean shutdown: background thread joined in
finallyblock before exit
- Cleanup: Removed duplicate
import threadinginside__init__
- Instant scroll response on macOS: Refactored to use background thread for stats updates
update_stats()now signals background thread instead of blocking- Scroll keys (
←/→) redraw immediately without waiting for GPU queries getch()timeout (50ms) instead ofnodelay()+ sleep pattern
- Non-blocking architecture: Stats update every 100ms in background thread
- Performance: Scroll response now instant even with slow GPU monitoring tools
- macmon dependency documented: README now clearly states
macmonis required for accurate macOS GPU stats- Added install instructions (
cargo install macmonor build from source) - Clarified that
macmonbinary must be inPATH(e.g.,~/bin/) - Split Requirements into Linux and macOS subsections for clarity
- Added install instructions (
- macOS GPU utilization via
socpwrbud: Addedsocpwrbudas a sudoless fallback for GPU utilization- Reads GPU active residency from IOReport power counters (no elevated privileges needed)
- Fallback chain:
socpwrbud→powermetrics(requires sudo on macOS 13+) - Startup warning if neither tool is found, recommending installation
- Cross-platform support (Linux + macOS): termmon now auto-detects platform and GPU backend
- System stats (CPU, memory, swap, per-core) now use
psutil— works on both Linux and macOS
- System stats (CPU, memory, swap, per-core) now use
- GPU backend auto-detection: NVIDIA (
nvidia-smi) on Linux, Apple Silicon (macmon/socpwrbud/powermetrics+sysctl) on macOS - macOS GPU utilization fix: Three-tier fallback —
macmon(preferred, actively maintained, no sudo),socpwrbud(fallback, no sudo),powermetrics(last resort, requires sudo)- Apple Silicon GPU stats: model name, GPU core count, utilization %, power draw
- Unified Memory Architecture (UMA) awareness — shows "shared w/ system memory" instead of VRAM bar on Apple Silicon
- GPU process tracking on macOS via
psutil.process_iter()(host memory as proxy for GPU activity) - Dynamic GPU section title and "no data" messages per platform
- Single
powermetricscall for both utilization and power (was two calls) - Added
psutilas the only external dependency - Graceful fallback to "no GPU" when monitoring tools are unavailable or restricted
- CPU and GPU process sections padded: Added 1-space padding between content and box borders in CPU per-core rows and GPU process table
- CPU title line, per-core rows, and GPU process title/header/data rows all have side padding now
- Scrolled process viewport and max scroll calculation adjusted for the extra 2 chars of padding
- Documentation and terminal compatibility cleanup: README and module docstring now document the current
←/→GPU process scroll keys and v1.7 CPU/process layouts- Wraps
curses.curs_set(0)so terminals that cannot hide the cursor do not crash the dashboard
- Wraps
- CPU bars compacted and recolored: Per-core rows now put the utilization bar directly after the
Core n:label, with the percentage after the bar- Restores cyan/bold filled CPU bar segments while keeping stable whole-row rendering
- Preserves two-column CPU layout and Core 10+ alignment without the large label-to-bar gap
- nvtop-style GPU process table: Replaced wrapped multi-line process commands with a single-line table:
PID USER DEV TYPE GPU GPU MEM CPU HOST MEM Command- Left/right arrow keys horizontally scroll the command column to reveal long arguments
- Fixed metadata columns stay visible while the command viewport scrolls
- CPU row rendering stabilized: Per-core CPU rows are now composed as complete bordered strings and written once per row
- Avoids partial curses writes/draw_bar positioning drift on narrow/mobile terminals
- Keeps two-column CPU layout and overall CPU in the title
- Inline GPU process command start: First command fragment now starts on the same row as PID/GPU/HOST/USER metadata under the
PROCESSESheader- Saves the remaining wasted vertical row in the GPU process section
- Continuation command lines still wrap across the full process box width
- CPU tile vertical compaction: Moved overall CPU percentage into the CPU title line after the core count
- Removes the separate
OverallCPU row, freeing one vertical row for the GPU process command section - Keeps per-core CPU rows unchanged
- Removes the separate
- Aligned compact GPU process columns: PID/GPU/HOST/USER headers now use the same fixed-width columns as the metadata row below
- Keeps a single header/title row to avoid stealing command parameter space
- Keeps command parameters full-width below the aligned metadata row
- iPad GPU process rows compacted again: moved the column labels into the GPU process title and removed the extra header/separator pair
- Keeps PID/GPU/HOST/USER visible in one compact process row
- Saves two vertical rows so late command flags remain visible on short terminals
- Removes the trailing blank separator after the last process
- Compact GPU process header restored: Shows PID, GPU memory, host memory, and user above each command while preserving full-width command wrapping
- Header:
PID GPU MEM HOST MEM USER - Process summary appears before the command line, so key resource data is visible at a glance
- Command parameters still wrap across almost the full box width
- Header:
- Command-first GPU process layout: Command line parameters now render before metadata so they remain visible on short iPad terminals
- Removed the verbose helper heading that wasted vertical space
- Full command wraps across almost the entire GPU process box
- PID/user/GPU/HOST metadata appears after the command instead of pushing it down
- iPad/narrow-terminal GPU process layout: Metadata now appears on its own line and command lines get nearly the full box width
- Replaced the old wide
PID | USER | GPU MEM | HOST MEM | Commandrow that consumed 50 columns before the command - Command wrapping now has ~72 chars in an 80-column box instead of ~29 chars
- Keeps GPU/HOST memory visible without sacrificing the command line
- Replaced the old wide
- Help popup overhaul: Styled popup matching termepub pattern
- White-on-blue colored background (new
COLOR_POPUPpair) +/-/|border chars with popup color- Yellow bold title on blue background
- Blocking
getch()— stays up until user presses any key - Dashboard drawn underneath first so it's ready when dismissed
stdscr.refresh()called explicitly (fixes popup not rendering)nodelaytoggled off/on around the blocking key wait
- White-on-blue colored background (new
- Code quality pass: Comprehensive fixes from systematic code review
- Removed unused
LABEL_WIDTHconstant (dead code) - Fixed help popup box chars: single-line (
┌┐└┘) to match rest of UI (was mixed double-line╔╗╚╝) - Fixed
except ExceptionswallowingKeyboardInterruptin 3 locations (clean Ctrl+C exit) - Cached core count in
__init__(reads/proc/cpuinfoonce instead of every refresh cycle) - Added
SIGWINCHhandler for graceful terminal resize (forces full redraw) - Parallelized
nvidia-smicalls: GPU stats and GPU processes now query concurrently viaconcurrent.futures(faster refresh on multi-GPU systems)
- Removed unused
- Major command wrapping overhaul: Fixed word truncation, unnecessary line breaks, and path splitting
- Extracted
_wrap_command()into a dedicated method (4-phase pipeline) - Fixed
cmd_widthcalculation: corrected column prefix from 42 to 51 chars (was clipping 8 chars) - Path continuation segments (
__PCONT__) wrap independently while maintaining/joins - Flag+path pairs (
-m /path/to/file) keep the flag with the first segment, remaining segments wrap naturally - No more truncated words, no more broken paths, no more unnecessary breaks
- Extracted
- Code cleanup: Moved runtime
import osandimport pwdto top level - Performance: Merged duplicate
/proc/[pid]/statusreads into single pass
- Continuation line alignment: Fixed GPU process command wrapping
- Continuation lines now align perfectly with command column
- Corrected indent calculation: 50 chars (was 48, briefly 52)
- Memory columns are 8 chars + "MB" suffix, properly accounted for
- Version in header: Display version number in title bar
- Header now shows:
termmon 1.5.5 - System Monitor - Version visible at a glance without checking docs
- Header now shows:
- Flag-value pair wrapping: Command-line flags stay with their values
--cache-ram 4096no longer splits across lines- Flags starting with
-or--are paired with following non-flag arguments - Cleaner, more readable command display
- Path separator fix: Long paths now preserve
/between segments- Path segments rejoin with
/instead of spaces when wrapping - Proper context tracking ensures arguments stay separate from paths
- Clean, readable command display with correct path formatting
- Path segments rejoin with
- Command wrapping fix: Intelligent path splitting for long commands
- Paths longer than 50 chars are split on
/for better readability - Words wrap naturally at space boundaries
- Continuation lines chunk properly if they exceed available width
- No more truncated words or unnecessary line breaks
- Paths longer than 50 chars are split on
- GPU column layout adjustment: Swapped Util and VRAM columns
- Row 2 now shows Util (left) + VRAM (right)
- Better visual hierarchy: quick utilization check first, then detailed VRAM
- GPU display optimization: Two-column compact layout
- Row 1: GPU name (summary stats moved to the section title)
- Row 2: VRAM bar (left) + Util bar (right) on same line
- Cuts GPU section from 4 rows down to 2 rows
- Much more compact for multi-GPU systems
- CPU display optimization: Two-column core layout
- Cores displayed in two columns (left/right) instead of single column
- Cuts vertical space in half for multi-core systems
- Overall CPU usage line aligned with core lines
- Progress bars start at same position for visual consistency
- Much more compact display for 8+ core systems
- GPU process improvements: Better command display
- Shows full command line with arguments (from /proc/[pid]/cmdline)
- Word-wraps long commands across multiple lines
- Continuation lines properly aligned with command column
- Auto-fits box width to terminal (85% of width, 80-120 chars)
- Cleaner display: just command basename + args, no full paths
- UI improvements: Compact, consistent display format
- System memory: Single-line
Mem: 12.5GB/15.4G ████████ 81.2%format - VRAM: Now shows GB instead of MB for consistency (
38.6GB/24.0G) - GPU utilization: Percentage aligns with VRAM numbers
- Removed redundant "Total" and "Available" memory lines
- All progress bars now start at same position for visual consistency
- System memory: Single-line
- New: GPU process tracking (nvtop-style)
- Shows top 5 GPU compute processes by VRAM usage
- Displays PID, user, GPU memory, host memory, and command
- Enriched with
/procdata for user and host memory
- Initial release: Production-ready system monitor
- Features: CPU, memory, swap, GPU monitoring
- Design: Clean ASCII box layout with color-coded progress bars
MIT
Ifor Evans (@iforevans)
Pair programmed with OpenClaw Agent Sparky ⚡