fix: clamp progress bar value to 0-100 range (#176)

Prevents visual glitches if context usage reports unexpected values
outside the expected 0-100 percentage range.
This commit is contained in:
Joshua Shanks
2026-01-19 12:47:49 -08:00
committed by GitHub
parent 80414a785b
commit 99362f1e5f

View File

@@ -22,7 +22,7 @@ process.stdin.on('end', () => {
let ctx = '';
if (remaining != null) {
const rem = Math.round(remaining);
const used = 100 - rem;
const used = Math.max(0, Math.min(100, 100 - rem));
// Build progress bar (10 segments)
const filled = Math.floor(used / 10);