From 38dad925528e05f2084474ead5519a6a6ceb70f7 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 2 Jun 2026 13:04:37 -0500 Subject: fix(ai-vterm): make F9 a faithful toggle of the agent split F9 toggle-off used quit-restore-window to dismiss the agent. With several agents alive sharing one slot, switching among them (C-F9) reuses the window via set-window-buffer, which leaves the window's quit-restore parameter pointing at the first agent shown. Once stale, quit-restore-window falls back to switch-to-prev-buffer and surfaces a different agent instead of removing the window, so F9 appeared to "show another agent" rather than hide the split. Toggle-off now collapses the split with delete-window, which is independent of the slot's buffer history, so the working buffer reclaims the frame. Geometry is captured first so the next toggle-on re-splits at the same width. Toggle-on reopens the exact agent that was hidden (new cj/--ai-vterm-last-hidden-buffer), falling back to the most-recent agent only when that buffer has been killed. Hide-then-show is now a faithful round trip, not a jump to whichever agent is most-recent in buffer-list. Sole-window toggle-off returns to the most-recent non-agent buffer instead of other-buffer, which could land on another agent. I updated the two reuse-edge-window tests that asserted the old restore-displaced-into-a-kept-slot behavior to match the new always-collapse behavior. --- todo.org | 3 +++ 1 file changed, 3 insertions(+) (limited to 'todo.org') diff --git a/todo.org b/todo.org index 2c43c28f..c0c47baf 100644 --- a/todo.org +++ b/todo.org @@ -41,6 +41,9 @@ Tags are additive. For example, a small wrong-behavior fix can be =:bug:quick:=, and a feature that requires internal restructuring can be =:feature:refactor:=. * Emacs Open Work +** DONE [#A] f9 should toggle the entire ai-vterm split, not just the buffer +CLOSED: [2026-06-02 Tue] +F9 toggle-off now collapses the agent split (delete-window) instead of quit-restore-window, which went stale across multi-agent slot reuse and surfaced a different agent. Toggle-on reopens the exact agent that was hidden (cj/--ai-vterm-last-hidden-buffer). Sole-window toggle-off returns to the most-recent non-agent buffer. Split width preserved across the toggle. ** DOING [#B] Signal client — forked signel :feature: :PROPERTIES: :LAST_REVIEWED: 2026-05-28 -- cgit v1.2.3