From 38ce367d92e66e8a8e91e12af7a935097fb6f00b Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 18 Jul 2026 14:06:46 -0500 Subject: docs(ai-term): match reuse-edge docstring to delete-window reality The docstring promised toggle-off puts the displaced buffer back via quit-restore-window. Toggle-off deliberately deletes the window instead: the slot's quit-restore parameter goes stale when several agents share it. That staleness is the "F9 shows another agent" bug the delete-window design killed. --- modules/ai-term-display.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/ai-term-display.el b/modules/ai-term-display.el index b78a2638..fdb2b7ed 100644 --- a/modules/ai-term-display.el +++ b/modules/ai-term-display.el @@ -248,10 +248,13 @@ or a layout split on the other axis), so the chain falls through to nil when the edge window is dedicated -- those are not ours to replace. Records the displaced buffer through `display-buffer-record-window' -\(type `reuse') before swapping, so the native `quit-restore-window' -called at toggle-off puts that buffer back into the slot instead of -deleting the window -- toggling swaps the slot's buffer between the -displaced buffer and the agent, never changing the window count. +\(type `reuse') before swapping. Toggle-off does NOT put that buffer +back: `cj/--ai-term-toggle-off' deletes the agent's window outright in +multi-window layouts, because the slot's `quit-restore' parameter goes +stale when several agents share it (see its docstring). The displaced +buffer stays alive and reachable through normal buffer switching; the +record call just keeps the window's `quit-restore' parameter accurate +for native `quit-window' paths outside the toggle. Runs after `cj/--ai-term-reuse-existing-agent', so an agent already on screen has been handled already; the window reused here always holds a -- cgit v1.2.3