diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-05 05:28:58 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-05 05:28:58 -0500 |
| commit | ebdf9e466b0e1f86e9b7d76650ac32408273e7a7 (patch) | |
| tree | dab9b453f3a93c324b5388b3843502a088c7ed46 /tests/test-ai-term--agent-buffers.el | |
| parent | c094b2e4e64530379a9cb273303308a9affcabf6 (diff) | |
| download | dotemacs-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-term--agent-buffers.el')
| -rw-r--r-- | tests/test-ai-term--agent-buffers.el | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/tests/test-ai-term--agent-buffers.el b/tests/test-ai-term--agent-buffers.el new file mode 100644 index 00000000..20c661c4 --- /dev/null +++ b/tests/test-ai-term--agent-buffers.el @@ -0,0 +1,59 @@ +;;; test-ai-term--agent-buffers.el --- Tests for cj/--ai-term-agent-buffers -*- lexical-binding: t; -*- + +;;; Commentary: +;; The helper returns the list of buffers whose names start with the +;; literal prefix "agent [". Order is the same order `buffer-list' +;; gives them (most-recently-selected first). Non-agent buffers and +;; buffers whose names merely contain the prefix as a substring are +;; excluded. + +;;; Code: + +(require 'ert) + +(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) +(add-to-list 'load-path (expand-file-name "tests" user-emacs-directory)) +(require 'ai-term) +(require 'testutil-ghostel-buffers) + +(ert-deftest test-ai-term--agent-buffers-empty-when-none-exist () + "Boundary: no agent-prefixed buffers anywhere -> empty list." + (cj/test--kill-agent-buffers) + (unwind-protect + (should (null (cj/--ai-term-agent-buffers))) + (cj/test--kill-agent-buffers))) + +(ert-deftest test-ai-term--agent-buffers-returns-only-agent-buffers () + "Normal: filters to only agent-prefixed buffers, leaves others alone." + (cj/test--kill-agent-buffers) + (let ((c1 (get-buffer-create "agent [a]")) + (c2 (get-buffer-create "agent [b]")) + (other (get-buffer-create "regular-buffer"))) + (unwind-protect + (let ((result (cj/--ai-term-agent-buffers))) + (should (memq c1 result)) + (should (memq c2 result)) + (should-not (memq other result)) + (should (= (length result) 2))) + (kill-buffer c1) + (kill-buffer c2) + (kill-buffer other)))) + +(ert-deftest test-ai-term--agent-buffers-anchors-prefix-not-substring () + "Boundary: 'foo agent [bar]' is not an agent buffer -- prefix anchored." + (cj/test--kill-agent-buffers) + (let ((not-agent (get-buffer-create "foo agent [bar]"))) + (unwind-protect + (should-not (memq not-agent (cj/--ai-term-agent-buffers))) + (kill-buffer not-agent)))) + +(ert-deftest test-ai-term--agent-buffers-bare-agent-not-included () + "Boundary: 'agent' alone (no bracket) doesn't match the 'agent [' prefix." + (cj/test--kill-agent-buffers) + (let ((bare (get-buffer-create "agent"))) + (unwind-protect + (should-not (memq bare (cj/--ai-term-agent-buffers))) + (kill-buffer bare)))) + +(provide 'test-ai-term--agent-buffers) +;;; test-ai-term--agent-buffers.el ends here |
