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/testutil-ghostel-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/testutil-ghostel-buffers.el')
| -rw-r--r-- | tests/testutil-ghostel-buffers.el | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/testutil-ghostel-buffers.el b/tests/testutil-ghostel-buffers.el new file mode 100644 index 00000000..52fb27e0 --- /dev/null +++ b/tests/testutil-ghostel-buffers.el @@ -0,0 +1,49 @@ +;;; testutil-ghostel-buffers.el --- Shared helpers for ghostel/agent buffer tests -*- lexical-binding: t; -*- + +;;; Commentary: +;; Cleanup helpers and a fake-ghostel constructor used across the +;; ai-term and term-toggle test files. Replaces the older +;; testutil-vterm-buffers helpers when the terminal engine moved from +;; vterm to ghostel. + +;;; Code: + +(require 'cl-lib) + +(defun cj/test--call-as-gui (fn) + "Call FN, stubbing `env-terminal-p' to return nil (a GUI frame). + +The terminal refuse-guard was dropped when ghostel replaced vterm (ghostel +renders in TTY frames too), so this no longer gates behavior; it is kept as a +thin passthrough so window-behavior tests written against the old guard keep +working unchanged." + (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)) + (when (string-prefix-p prefix (buffer-name b)) + (kill-buffer b)))) + +(defun cj/test--kill-agent-buffers () + "Kill all live buffers whose name matches the AI-term prefix \"agent [\"." + (cj/test--kill-buffers-matching-prefix "agent [")) + +(defun cj/test--kill-test-term-buffers () + "Kill all live buffers whose name starts with \"*test-term\"." + (cj/test--kill-buffers-matching-prefix "*test-term")) + +(defun cj/test--make-fake-ghostel-buffer (name) + "Return a buffer named NAME with `major-mode' set to `ghostel-mode'. + +Avoids actually launching a ghostel process by setting the mode +buffer-locally. Used by tests that need a buffer satisfying the +ghostel-mode predicate without the side-effects of `(ghostel)'." + (let ((buf (get-buffer-create name))) + (with-current-buffer buf + (setq-local major-mode 'ghostel-mode)) + buf)) + +(provide 'testutil-ghostel-buffers) +;;; testutil-ghostel-buffers.el ends here |
