Adaptive panel width: selects from four tiers based on $COLUMNS (52, 70, 74, or 78 chars wide), with a 6-column buffer on each side before stepping up — ensures the box never crowds the terminal edges
Richer descriptions: each tier carries progressively more detailed category descriptions (e.g. ls→eza, cat→bat, cd→zoxide, rm→trash at 74-wide vs cmd shadows at 52-wide)
Horizontal centering: left-padding prefix computed from (COLUMNS - box_width) / 2 on every draw; rerenders automatically on resize
Live resize detection: key reader changed from stty min 1 time 1 (blocks forever) to min 0 time 3 (0.3 s poll); event loop detects $COLUMNS change and redraws without requiring a keypress
Wrap-aware erase: replaces fixed \e[14A\e[J with a formula — ⌊(last_cols + 78) / 2⌋ / COLUMNS gives the wrap factor so panels drawn on a wider terminal are fully cleared after the terminal narrows, eliminating ghost lines
Documents adaptive width tiers and resize behaviour
README.md
Updates config-toggle blurb with width/centering/resize info
Manual Verification
Run config-toggle in a terminal ≥ 90 columns wide — panel should be 78-wide and centered
Resize terminal to 86–89 columns — panel should reflow to 74-wide within ~0.3 s (no keypress needed)
Resize to 82–85 columns — panel reflows to 70-wide
Resize below 82 columns — panel reflows to 52-wide (original)
Resize from narrow back to wide — no ghost lines or duplicate panels left on screen
Navigate with arrow keys, h/j/k/l, Tab, and q — all behave as before
Toggle a value, resize, then quit — panel erases cleanly at new terminal width
## Summary
- **Adaptive panel width**: selects from four tiers based on `$COLUMNS` (52, 70, 74, or 78 chars wide), with a 6-column buffer on each side before stepping up — ensures the box never crowds the terminal edges
- **Richer descriptions**: each tier carries progressively more detailed category descriptions (e.g. `ls→eza, cat→bat, cd→zoxide, rm→trash` at 74-wide vs `cmd shadows` at 52-wide)
- **Horizontal centering**: left-padding prefix computed from `(COLUMNS - box_width) / 2` on every draw; rerenders automatically on resize
- **Live resize detection**: key reader changed from `stty min 1 time 1` (blocks forever) to `min 0 time 3` (0.3 s poll); event loop detects `$COLUMNS` change and redraws without requiring a keypress
- **Wrap-aware erase**: replaces fixed `\e[14A\e[J` with a formula — `⌊(last_cols + 78) / 2⌋ / COLUMNS` gives the wrap factor so panels drawn on a wider terminal are fully cleared after the terminal narrows, eliminating ghost lines
## Files changed
| File | Change |
|------|--------|
| `functions/__config_toggle_draw.fish` | Width tier logic, centering prefix, adaptive descriptions |
| `functions/__config_toggle_read_key.fish` | `min 0 time 3` for timeout-based polling |
| `functions/config-toggle.fish` | `last_cols` tracking, skip-on-idle-timeout, wrap-aware erase |
| `docs/fish-config.md` | Documents adaptive width tiers and resize behaviour |
| `README.md` | Updates `config-toggle` blurb with width/centering/resize info |
## Manual Verification
- [x] Run `config-toggle` in a terminal ≥ 90 columns wide — panel should be 78-wide and centered
- [x] Resize terminal to 86–89 columns — panel should reflow to 74-wide within ~0.3 s (no keypress needed)
- [x] Resize to 82–85 columns — panel reflows to 70-wide
- [x] Resize below 82 columns — panel reflows to 52-wide (original)
- [x] Resize from narrow back to wide — no ghost lines or duplicate panels left on screen
- [x] Navigate with arrow keys, `h`/`j`/`k`/`l`, Tab, and `q` — all behave as before
- [x] Toggle a value, resize, then quit — panel erases cleanly at new terminal width
Panel now selects from four width tiers based on $COLUMNS (with a 6-col
buffer per side before stepping up): 52-wide (default), 70, 74, or 78.
Each tier carries richer category descriptions sized to fit the layout.
The box is horizontally centered on every draw via a left-padding prefix.
Key reader switches from stty min 1 to min 0 / time 3, giving a 0.3 s
poll interval so COLUMNS changes are detected without a keypress. The
erase formula is now wrap-aware: prev_max_line_width / COLUMNS gives the
wrap factor, ensuring old wider panels are fully cleared after narrowing.
Idle timeout ticks that detect no resize are skipped entirely.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
$COLUMNS(52, 70, 74, or 78 chars wide), with a 6-column buffer on each side before stepping up — ensures the box never crowds the terminal edgesls→eza, cat→bat, cd→zoxide, rm→trashat 74-wide vscmd shadowsat 52-wide)(COLUMNS - box_width) / 2on every draw; rerenders automatically on resizestty min 1 time 1(blocks forever) tomin 0 time 3(0.3 s poll); event loop detects$COLUMNSchange and redraws without requiring a keypress\e[14A\e[Jwith a formula —⌊(last_cols + 78) / 2⌋ / COLUMNSgives the wrap factor so panels drawn on a wider terminal are fully cleared after the terminal narrows, eliminating ghost linesFiles changed
functions/__config_toggle_draw.fishfunctions/__config_toggle_read_key.fishmin 0 time 3for timeout-based pollingfunctions/config-toggle.fishlast_colstracking, skip-on-idle-timeout, wrap-aware erasedocs/fish-config.mdREADME.mdconfig-toggleblurb with width/centering/resize infoManual Verification
config-togglein a terminal ≥ 90 columns wide — panel should be 78-wide and centeredh/j/k/l, Tab, andq— all behave as before