aboutsummaryrefslogtreecommitdiff
path: root/tests/test-ai-vterm--close.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-05 05:28:58 -0500
committerCraig Jennings <c@cjennings.net>2026-06-05 05:28:58 -0500
commitebdf9e466b0e1f86e9b7d76650ac32408273e7a7 (patch)
treedab9b453f3a93c324b5388b3843502a088c7ed46 /tests/test-ai-vterm--close.el
parentc094b2e4e64530379a9cb273303308a9affcabf6 (diff)
downloaddotemacs-ebdf9e466b0e1f86e9b7d76650ac32408273e7a7.tar.gz
dotemacs-ebdf9e466b0e1f86e9b7d76650ac32408273e7a7.zip
feat(term): replace vterm with ghostel as the terminal engine
I swapped the terminal engine from vterm to ghostel (libghostty-vt) everywhere. term-config replaces vterm-config (the F12 terminal, the C-; x menu, tmux history capture), and ai-term replaces ai-vterm (the F9 Claude-agent launcher). ghostel renders the agent TUI without vterm's flicker under heavy streaming, and one engine now covers every terminal workflow. Two behavior changes fall out of the swap. F9 launches in a terminal frame now: ghostel renders in TTY frames, so the old GUI-only guard is gone. Terminal windows no longer dim when unfocused: ghostel resolves its palette into the native module per-terminal, so there's no per-window color hook to dim through the way vterm had. auto-dim drops its vterm color-advice path, the dashboard Terminal button launches ghostel, and the vterm and vterm-toggle packages are removed. The tmux pane-history and copy-mode machinery carried over unchanged. It keys on the pty tty, which ghostel exposes.
Diffstat (limited to 'tests/test-ai-vterm--close.el')
-rw-r--r--tests/test-ai-vterm--close.el86
1 files changed, 0 insertions, 86 deletions
diff --git a/tests/test-ai-vterm--close.el b/tests/test-ai-vterm--close.el
deleted file mode 100644
index eb89bcc2..00000000
--- a/tests/test-ai-vterm--close.el
+++ /dev/null
@@ -1,86 +0,0 @@
-;;; test-ai-vterm--close.el --- Tests for graceful agent close -*- lexical-binding: t; -*-
-
-;;; Commentary:
-;; `cj/ai-vterm-close' tears an agent down gracefully: kill its tmux
-;; session (stopping the agent process), kill the vterm buffer, and
-;; remove its window. These tests cover the pure pieces -- the
-;; tmux-kill helper, the per-buffer teardown, and the target selection --
-;; with `process-file' and the prompt mocked at the boundary.
-
-;;; Code:
-
-(require 'ert)
-(require 'cl-lib)
-
-(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory))
-(require 'ai-vterm)
-
-(ert-deftest test-ai-vterm--kill-tmux-session-runs-kill-session ()
- "Normal: invokes `tmux kill-session -t <session>'."
- (let (captured)
- (cl-letf (((symbol-function 'process-file)
- (lambda (program &rest args)
- (setq captured (cons program args))
- 0)))
- (cj/--ai-vterm-kill-tmux-session "aiv-foo"))
- (should (equal (car captured) "tmux"))
- (should (member "kill-session" captured))
- (should (member "-t" captured))
- (should (member "aiv-foo" captured))))
-
-(ert-deftest test-ai-vterm--kill-tmux-session-swallows-error ()
- "Error: returns nil when tmux is unavailable (process-file signals)."
- (cl-letf (((symbol-function 'process-file)
- (lambda (&rest _) (error "no tmux"))))
- (should (null (cj/--ai-vterm-kill-tmux-session "aiv-foo")))))
-
-(ert-deftest test-ai-vterm--close-buffer-kills-session-and-buffer ()
- "Normal: derives the session from default-directory, kills it and the buffer."
- (let ((buf (get-buffer-create "agent [foo]"))
- captured-session)
- (with-current-buffer buf (setq-local default-directory "/tmp/foo/"))
- (cl-letf (((symbol-function 'cj/--ai-vterm-kill-tmux-session)
- (lambda (s) (setq captured-session s) 0)))
- (cj/--ai-vterm-close-buffer buf))
- (should (equal captured-session "aiv-foo"))
- (should-not (buffer-live-p buf))))
-
-(ert-deftest test-ai-vterm--close-buffer-noop-on-non-agent ()
- "Boundary: does nothing for a buffer that is not an agent buffer."
- (let ((buf (get-buffer-create "*not-an-agent*"))
- (called nil))
- (unwind-protect
- (progn
- (cl-letf (((symbol-function 'cj/--ai-vterm-kill-tmux-session)
- (lambda (_s) (setq called t) 0)))
- (cj/--ai-vterm-close-buffer buf))
- (should-not called)
- (should (buffer-live-p buf)))
- (when (buffer-live-p buf) (kill-buffer buf)))))
-
-(ert-deftest test-ai-vterm--close-target-current-agent-buffer ()
- "Normal: returns the current buffer when it is an agent buffer."
- (let ((buf (get-buffer-create "agent [cur]")))
- (unwind-protect
- (with-current-buffer buf
- (should (eq (cj/--ai-vterm-close-target) buf)))
- (kill-buffer buf))))
-
-(ert-deftest test-ai-vterm--close-target-sole-agent ()
- "Normal: returns the only live agent buffer when current isn't an agent."
- (let ((buf (get-buffer-create "agent [only]")))
- (unwind-protect
- (with-temp-buffer
- (cl-letf (((symbol-function 'cj/--ai-vterm-agent-buffers)
- (lambda () (list buf))))
- (should (eq (cj/--ai-vterm-close-target) buf))))
- (kill-buffer buf))))
-
-(ert-deftest test-ai-vterm--close-target-none-returns-nil ()
- "Boundary: nil when current buffer isn't an agent and none are alive."
- (with-temp-buffer
- (cl-letf (((symbol-function 'cj/--ai-vterm-agent-buffers) (lambda () nil)))
- (should (null (cj/--ai-vterm-close-target))))))
-
-(provide 'test-ai-vterm--close)
-;;; test-ai-vterm--close.el ends here