diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-31 16:20:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-31 16:20:34 -0500 |
| commit | b72e794be60c5d4e94c61e5af8c08245773e3393 (patch) | |
| tree | c1a3f3cdce0ffed773213c0180badffc58843e14 /tests/testutil-vterm-buffers.el | |
| parent | 79db37565a356dead9a4c663361e77627d83d864 (diff) | |
| download | dotemacs-b72e794be60c5d4e94c61e5af8c08245773e3393.tar.gz dotemacs-b72e794be60c5d4e94c61e5af8c08245773e3393.zip | |
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.
Diffstat (limited to 'tests/testutil-vterm-buffers.el')
| -rw-r--r-- | tests/testutil-vterm-buffers.el | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/testutil-vterm-buffers.el b/tests/testutil-vterm-buffers.el index 01a65d90..17f0a69a 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)) |
