From 4e924fddebf3ccbfe41fda437ef0ca02cfed4e58 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 31 May 2026 16:20:34 -0500 Subject: feat(ai-vterm): gate the F9 launcher to GUI frames AI-vterm launches a graphical vterm side window, so F9 / C-F9 / M-F9 now decline with a message in a terminal frame instead of opening a vterm. The guard checks the current frame at command time rather than at load. That matters under the daemon, which serves GUI and terminal frames both with display-graphic-p nil at load, so a load-time gate would have disabled the launcher in its GUI frames too. Routed the three window-behavior tests through a GUI-frame stub, since a batch run is itself a terminal frame. --- tests/test-ai-vterm--reuse-edge-window.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/test-ai-vterm--reuse-edge-window.el') diff --git a/tests/test-ai-vterm--reuse-edge-window.el b/tests/test-ai-vterm--reuse-edge-window.el index a7009423a..9f6214771 100644 --- a/tests/test-ai-vterm--reuse-edge-window.el +++ b/tests/test-ai-vterm--reuse-edge-window.el @@ -175,7 +175,7 @@ window count stays 2 (the native `quit-restore-window' puts 2 back)." (should (= (count-windows) 2)) (should (member agent-name (cj/test--displayed-buffer-names))) ;; Toggle off -> the displaced buffer (2) returns to the slot. - (cj/ai-vterm) + (cj/test--call-as-gui #'cj/ai-vterm) (should (= (count-windows) 2)) (let ((bufs (cj/test--displayed-buffer-names))) (should (member right-name bufs)) @@ -213,11 +213,11 @@ the same width." (display-buffer agent-buf) (should (= (count-windows) 2)) ;; off - (cj/ai-vterm) + (cj/test--call-as-gui #'cj/ai-vterm) (should (= (count-windows) 2)) (should-not (cj/--ai-vterm-displayed-agent-window)) ;; on again - (cj/ai-vterm) + (cj/test--call-as-gui #'cj/ai-vterm) (should (= (count-windows) 2)) (let ((win (cj/--ai-vterm-displayed-agent-window))) (should (windowp win)) @@ -259,9 +259,9 @@ most-recent agent, which would now be the other one." (display-buffer a2) ; | left | A2 | (should (eq (window-buffer (cj/--ai-vterm-displayed-agent-window)) a2)) - (cj/ai-vterm) ; off -> | left | right | + (cj/test--call-as-gui #'cj/ai-vterm) ; off -> | left | right | (should-not (cj/--ai-vterm-displayed-agent-window)) - (cj/ai-vterm) ; on -> must bring A2 back + (cj/test--call-as-gui #'cj/ai-vterm) ; on -> must bring A2 back (should (eq (window-buffer (cj/--ai-vterm-displayed-agent-window)) a2)))))) (when (get-buffer left-name) (kill-buffer left-name)) -- cgit v1.2.3