From b72e794be60c5d4e94c61e5af8c08245773e3393 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/testutil-vterm-buffers.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/testutil-vterm-buffers.el') diff --git a/tests/testutil-vterm-buffers.el b/tests/testutil-vterm-buffers.el index 01a65d906..17f0a69a0 100644 --- a/tests/testutil-vterm-buffers.el +++ b/tests/testutil-vterm-buffers.el @@ -9,6 +9,19 @@ ;;; Code: +(require 'cl-lib) + +(defun cj/test--call-as-gui (fn) + "Call FN with `env-terminal-p' stubbed to return nil (a GUI frame). + +The AI-vterm interactive commands refuse to run in a terminal frame +via `cj/--ai-vterm-refuse-in-terminal'. A batch test run is itself a +terminal frame, so tests that exercise the GUI-frame window behavior +of those commands call them through this helper to present a GUI +context." + (cl-letf (((symbol-function 'env-terminal-p) (lambda () nil))) + (funcall fn))) + (defun cj/test--kill-buffers-matching-prefix (prefix) "Kill all live buffers whose name starts with PREFIX." (dolist (b (buffer-list)) -- cgit v1.2.3