From eb4aa232836f069ca671c6651a0e2f5dff4f7c34 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Fri, 26 Jun 2026 05:10:29 -0400 Subject: refactor(term): finish ghostel retirement (phase 5) Remove the dead ghostel app from theme-studio: the GHOSTEL_FACES/SEED data, the registry row, the renderGhostelPreview previewer, and the package_seed test, then regenerate the tool. ansi-color stays since eat inherits it. Rename testutil-ghostel-buffers to testutil-terminal-buffers and drop make-fake-ghostel-buffer; the toggle-filter test now uses the eat fixture, since agents are eat. Fix the comments that still called the agent buffers ghostel (they're eat now) in eat-config and the ai-term and auto-dim test docstrings. I also package-deleted the unused ghostel ELPA package. Full suite green; the remaining ghostel mentions are accurate migration history. --- tests/test-ai-term--agent-buffers.el | 2 +- tests/test-ai-term--close.el | 4 +- tests/test-ai-term--collapse-split.el | 2 +- tests/test-ai-term--dispatch.el | 2 +- tests/test-ai-term--display-saved.el | 2 +- tests/test-ai-term--displayed-agent-window.el | 2 +- tests/test-ai-term--launch-command.el | 2 +- tests/test-ai-term--reuse-edge-window.el | 2 +- tests/test-ai-term--reuse-existing-agent.el | 2 +- tests/test-ai-term--server-display.el | 2 +- tests/test-ai-term--single-window-toggle.el | 2 +- tests/test-auto-dim-config.el | 5 +- tests/test-term-tmux-history.el | 2 +- tests/test-term-toggle--buffer-filter.el | 12 ++--- tests/test-term-toggle--dispatch.el | 2 +- tests/testutil-ghostel-buffers.el | 70 --------------------------- tests/testutil-terminal-buffers.el | 57 ++++++++++++++++++++++ 17 files changed, 80 insertions(+), 92 deletions(-) delete mode 100644 tests/testutil-ghostel-buffers.el create mode 100644 tests/testutil-terminal-buffers.el (limited to 'tests') diff --git a/tests/test-ai-term--agent-buffers.el b/tests/test-ai-term--agent-buffers.el index 20c661c45..e0d8faa79 100644 --- a/tests/test-ai-term--agent-buffers.el +++ b/tests/test-ai-term--agent-buffers.el @@ -14,7 +14,7 @@ (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) +(require 'testutil-terminal-buffers) (ert-deftest test-ai-term--agent-buffers-empty-when-none-exist () "Boundary: no agent-prefixed buffers anywhere -> empty list." diff --git a/tests/test-ai-term--close.el b/tests/test-ai-term--close.el index 4098c091e..242bfd749 100644 --- a/tests/test-ai-term--close.el +++ b/tests/test-ai-term--close.el @@ -2,7 +2,7 @@ ;;; Commentary: ;; `cj/ai-term-close' tears an agent down gracefully: kill its tmux -;; session (stopping the agent process), kill the ghostel buffer, and +;; session (stopping the agent process), kill the agent 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. @@ -15,7 +15,7 @@ (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) +(require 'testutil-terminal-buffers) (ert-deftest test-ai-term--kill-tmux-session-runs-kill-session () "Normal: invokes `tmux kill-session -t '." diff --git a/tests/test-ai-term--collapse-split.el b/tests/test-ai-term--collapse-split.el index a09af5598..bae913624 100644 --- a/tests/test-ai-term--collapse-split.el +++ b/tests/test-ai-term--collapse-split.el @@ -23,7 +23,7 @@ (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) +(require 'testutil-terminal-buffers) ;;; cj/--ai-term-most-recent-non-agent-buffer diff --git a/tests/test-ai-term--dispatch.el b/tests/test-ai-term--dispatch.el index 91b5e1bc6..129c53cda 100644 --- a/tests/test-ai-term--dispatch.el +++ b/tests/test-ai-term--dispatch.el @@ -16,7 +16,7 @@ (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) +(require 'testutil-terminal-buffers) (ert-deftest test-ai-term--dispatch-window-displayed-returns-toggle-off () "Normal: displayed agent window -> (toggle-off . WIN)." diff --git a/tests/test-ai-term--display-saved.el b/tests/test-ai-term--display-saved.el index 51c22fde9..5707bea5b 100644 --- a/tests/test-ai-term--display-saved.el +++ b/tests/test-ai-term--display-saved.el @@ -26,7 +26,7 @@ (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) +(require 'testutil-terminal-buffers) (ert-deftest test-ai-term--display-saved-uses-desktop-defaults-when-state-nil () "Normal: nil state on a desktop -> rightmost, size=cj/ai-term-desktop-width. diff --git a/tests/test-ai-term--displayed-agent-window.el b/tests/test-ai-term--displayed-agent-window.el index eeb40ed31..ced3ff414 100644 --- a/tests/test-ai-term--displayed-agent-window.el +++ b/tests/test-ai-term--displayed-agent-window.el @@ -12,7 +12,7 @@ (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) +(require 'testutil-terminal-buffers) (ert-deftest test-ai-term--displayed-agent-window-no-buffers-returns-nil () "Boundary: no agent buffers anywhere -> nil." diff --git a/tests/test-ai-term--launch-command.el b/tests/test-ai-term--launch-command.el index 246e70a3f..e61c0e579 100644 --- a/tests/test-ai-term--launch-command.el +++ b/tests/test-ai-term--launch-command.el @@ -1,7 +1,7 @@ ;;; test-ai-term--launch-command.el --- Tests for cj/--ai-term-launch-command -*- lexical-binding: t; -*- ;;; Commentary: -;; The launch command is what gets typed into a fresh ghostel shell to bring +;; The launch command is what gets typed into a fresh shell to bring ;; up the agent inside a per-project tmux session. The session is named ;; `cj/ai-term-tmux-session-prefix' + the project basename, so a second ;; F9 on the same project reattaches to the running agent rather than diff --git a/tests/test-ai-term--reuse-edge-window.el b/tests/test-ai-term--reuse-edge-window.el index a9a0529e8..8ba2f759f 100644 --- a/tests/test-ai-term--reuse-edge-window.el +++ b/tests/test-ai-term--reuse-edge-window.el @@ -25,7 +25,7 @@ (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) +(require 'testutil-terminal-buffers) (defun cj/test--displayed-buffer-names () "Return the buffer names shown in the selected frame, left/top to right/bottom." diff --git a/tests/test-ai-term--reuse-existing-agent.el b/tests/test-ai-term--reuse-existing-agent.el index 3f0c64493..361e94be9 100644 --- a/tests/test-ai-term--reuse-existing-agent.el +++ b/tests/test-ai-term--reuse-existing-agent.el @@ -17,7 +17,7 @@ (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) +(require 'testutil-terminal-buffers) (ert-deftest test-ai-term--reuse-existing-agent-swaps-buffer-when-window-exists () "Normal: an agent window exists -> swap its buffer, return the window." diff --git a/tests/test-ai-term--server-display.el b/tests/test-ai-term--server-display.el index b3d32dc83..6db9cf2d3 100644 --- a/tests/test-ai-term--server-display.el +++ b/tests/test-ai-term--server-display.el @@ -16,7 +16,7 @@ (add-to-list 'load-path (expand-file-name "tests" user-emacs-directory)) (require 'ai-term) (require 'server) -(require 'testutil-ghostel-buffers) +(require 'testutil-terminal-buffers) (ert-deftest test-ai-term--non-agent-window-finds-code-window () "Normal: agent on the right, code on the left -> returns the code window." diff --git a/tests/test-ai-term--single-window-toggle.el b/tests/test-ai-term--single-window-toggle.el index aa507f032..bc6de89f8 100644 --- a/tests/test-ai-term--single-window-toggle.el +++ b/tests/test-ai-term--single-window-toggle.el @@ -19,7 +19,7 @@ (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) +(require 'testutil-terminal-buffers) ;;; Normal Cases diff --git a/tests/test-auto-dim-config.el b/tests/test-auto-dim-config.el index 532e7dfae..2686b88f3 100644 --- a/tests/test-auto-dim-config.el +++ b/tests/test-auto-dim-config.el @@ -8,8 +8,9 @@ ;; in ~/code and may be absent on a clean checkout. ;; ;; The vterm dim-integration tests were removed when the terminal engine moved -;; to ghostel: ghostel bakes its palette per-terminal (no per-window color -;; hook), so terminal buffers no longer participate in window dimming. +;; off vterm. EAT (the current engine) renders in real Emacs faces and uses the +;; `default' face for its background, so terminal buffers dim like any other +;; buffer with no dedicated integration. ;;; Code: diff --git a/tests/test-term-tmux-history.el b/tests/test-term-tmux-history.el index 08d39e5bf..633d7a02c 100644 --- a/tests/test-term-tmux-history.el +++ b/tests/test-term-tmux-history.el @@ -22,7 +22,7 @@ (setq load-prefer-newer t) (require 'eat) (require 'eat-config) -(require 'testutil-ghostel-buffers) +(require 'testutil-terminal-buffers) (defmacro test-term-tmux-history--with-tmux-mock (responses &rest body) "Run BODY with `process-file' mocked for tmux RESPONSES. diff --git a/tests/test-term-toggle--buffer-filter.el b/tests/test-term-toggle--buffer-filter.el index 6db2ec65c..f56459a06 100644 --- a/tests/test-term-toggle--buffer-filter.el +++ b/tests/test-term-toggle--buffer-filter.el @@ -5,8 +5,8 @@ ;; manages: the predicate `cj/--term-toggle-buffer-p', the list ;; `cj/--term-toggle-buffers', and the per-frame window finder ;; `cj/--term-toggle-displayed-window'. F12 opens eshell (run through EAT via -;; eat-eshell-mode), so it manages eshell-mode buffers. Standalone eat buffers, -;; ghostel buffers, and ai-term's agent buffers are NOT F12-managed. +;; eat-eshell-mode), so it manages eshell-mode buffers. Standalone eat buffers +;; and ai-term's agent buffers (also eat) are NOT F12-managed. ;;; Code: @@ -15,7 +15,7 @@ (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 'eat-config) -(require 'testutil-ghostel-buffers) +(require 'testutil-terminal-buffers) (defun test-term-toggle--cleanup () "Kill leftover agent- and *test-term- prefixed buffers." @@ -41,7 +41,7 @@ (ert-deftest test-term-toggle--buffer-p-rejects-agent () "Boundary: ai-term agent buffers are excluded from F12's set." (test-term-toggle--cleanup) - (let ((buf (cj/test--make-fake-ghostel-buffer "agent [project-a]"))) + (let ((buf (cj/test--make-fake-eat-buffer "agent [project-a]"))) (unwind-protect (should-not (cj/--term-toggle-buffer-p buf)) (kill-buffer buf)))) @@ -65,7 +65,7 @@ "Normal: returns the eshell terminal but not eat/agent buffers." (test-term-toggle--cleanup) (let ((esh (cj/test--make-fake-eshell-buffer "*test-term-esh*")) - (agent (cj/test--make-fake-ghostel-buffer "agent [for-test]"))) + (agent (cj/test--make-fake-eat-buffer "agent [for-test]"))) (unwind-protect (let ((result (cj/--term-toggle-buffers))) (should (memq esh result)) @@ -90,7 +90,7 @@ (ert-deftest test-term-toggle--displayed-window-skips-agent () "Boundary: only an agent terminal is displayed -> nil (agent not F12-managed)." (test-term-toggle--cleanup) - (let ((agent (cj/test--make-fake-ghostel-buffer "agent [skip-test]"))) + (let ((agent (cj/test--make-fake-eat-buffer "agent [skip-test]"))) (unwind-protect (save-window-excursion (delete-other-windows) diff --git a/tests/test-term-toggle--dispatch.el b/tests/test-term-toggle--dispatch.el index 0d17395cc..43db4c3fe 100644 --- a/tests/test-term-toggle--dispatch.el +++ b/tests/test-term-toggle--dispatch.el @@ -15,7 +15,7 @@ (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 'eat-config) -(require 'testutil-ghostel-buffers) +(require 'testutil-terminal-buffers) (ert-deftest test-term-toggle--dispatch-window-displayed-returns-toggle-off () "Normal: displayed terminal window -> (toggle-off . WIN)." diff --git a/tests/testutil-ghostel-buffers.el b/tests/testutil-ghostel-buffers.el deleted file mode 100644 index 8e26efec4..000000000 --- a/tests/testutil-ghostel-buffers.el +++ /dev/null @@ -1,70 +0,0 @@ -;;; 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)) - -(defun cj/test--make-fake-eat-buffer (name) - "Return a buffer named NAME with `major-mode' set to `eat-mode'. - -Avoids actually launching an EAT process by setting the mode buffer-locally. -Used by the F12 toggle tests that need a buffer satisfying the eat-mode -predicate without the side-effects of `(eat)'." - (let ((buf (get-buffer-create name))) - (with-current-buffer buf - (setq-local major-mode 'eat-mode)) - buf)) - -(defun cj/test--make-fake-eshell-buffer (name) - "Return a buffer named NAME with `major-mode' set to `eshell-mode'. - -Avoids starting a real eshell by setting the mode buffer-locally. Used by the -F12 toggle tests that need a buffer satisfying the eshell-mode predicate." - (let ((buf (get-buffer-create name))) - (with-current-buffer buf - (setq-local major-mode 'eshell-mode)) - buf)) - -(provide 'testutil-ghostel-buffers) -;;; testutil-ghostel-buffers.el ends here diff --git a/tests/testutil-terminal-buffers.el b/tests/testutil-terminal-buffers.el new file mode 100644 index 000000000..c2a43a3c7 --- /dev/null +++ b/tests/testutil-terminal-buffers.el @@ -0,0 +1,57 @@ +;;; testutil-terminal-buffers.el --- Shared helpers for terminal/agent buffer tests -*- lexical-binding: t; -*- + +;;; Commentary: +;; Cleanup helpers and fake-terminal-buffer constructors (eat, eshell) used +;; across the ai-term and term-toggle test files. + +;;; 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 the terminal engine moved off vterm +(EAT and eshell render 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-eat-buffer (name) + "Return a buffer named NAME with `major-mode' set to `eat-mode'. + +Avoids actually launching an EAT process by setting the mode buffer-locally. +Used by the F12 toggle tests that need a buffer satisfying the eat-mode +predicate without the side-effects of `(eat)'." + (let ((buf (get-buffer-create name))) + (with-current-buffer buf + (setq-local major-mode 'eat-mode)) + buf)) + +(defun cj/test--make-fake-eshell-buffer (name) + "Return a buffer named NAME with `major-mode' set to `eshell-mode'. + +Avoids starting a real eshell by setting the mode buffer-locally. Used by the +F12 toggle tests that need a buffer satisfying the eshell-mode predicate." + (let ((buf (get-buffer-create name))) + (with-current-buffer buf + (setq-local major-mode 'eshell-mode)) + buf)) + +(provide 'testutil-terminal-buffers) +;;; testutil-terminal-buffers.el ends here -- cgit v1.2.3