From dbee95ae877a3bf0d38bfd78891c3c2c9c576519 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 20 Jun 2026 15:29:33 -0400 Subject: fix(ai-term): stop F9 toggle shrinking the agent window each cycle The F9 toggle captured the agent window's body-height and replayed it as body-lines. Body-height subtracts the mode line's pixel height, which differs between an active and an inactive mode line; the agent is captured active but redisplayed inactive, so under a theme whose mode-line-inactive is shorter than a text line the window lost ~1 line per toggle. Capture and replay total-height for the vertical axis instead, via the renamed cj/window-replay-size. Total-height is identical active or inactive and has no mode-line-pixel dependence, so the round-trip is a fixed point. Width keeps body-width (total-width has the position-dependent divider problem that total- height does not). The shared lib fix covers the F12 terminal toggle too. The shrink only manifests in a GUI frame, so it is not reproducible in the batch harness; the unit tests pin the new total-height contract. --- modules/term-config.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'modules/term-config.el') diff --git a/modules/term-config.el b/modules/term-config.el index 33f54d75a..0a7991409 100644 --- a/modules/term-config.el +++ b/modules/term-config.el @@ -313,8 +313,9 @@ Symbol: right, left, or below. `above' is never stored. nil means use the default `below' for F12's traditional bottom split.") (defvar cj/--term-toggle-last-size nil - "Last user-chosen body size for the F12 terminal display. -Positive integer: body-cols (right/left) or body-lines (below/above). + "Last user-chosen size for the F12 terminal display. +Positive integer: body-cols (right/left) or total-lines (below/above) -- see +`cj/window-replay-size' for why the vertical axis uses total, not body. nil means fall back to `cj/term-toggle-window-height' as a fraction.") (defun cj/--term-toggle-buffer-p (buffer) -- cgit v1.2.3