aboutsummaryrefslogtreecommitdiff
path: root/tests/test-auto-dim-config.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-auto-dim-config.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-auto-dim-config.el')
-rw-r--r--tests/test-auto-dim-config.el106
1 files changed, 4 insertions, 102 deletions
diff --git a/tests/test-auto-dim-config.el b/tests/test-auto-dim-config.el
index 4648f062..532e7dfa 100644
--- a/tests/test-auto-dim-config.el
+++ b/tests/test-auto-dim-config.el
@@ -6,6 +6,10 @@
;; fringe from the dimmed faces to avoid flicker on this non-pgtk build, and
;; enable the global mode. Guarded with `skip-unless' because the fork lives
;; 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.
;;; Code:
@@ -30,108 +34,6 @@
(when (fboundp 'auto-dim-other-buffers-mode)
(auto-dim-other-buffers-mode -1))))
-(ert-deftest test-auto-dim-config-vterm-dimmed-p-all-windows-dimmed ()
- "Normal: a vterm buffer is dimmed when all displayed windows are dimmed."
- (skip-unless (file-directory-p test-auto-dim--fork))
- (require 'auto-dim-config)
- (let ((major-mode 'vterm-mode))
- (cl-letf (((symbol-function 'get-buffer-window-list)
- (lambda (&rest _) '(left right)))
- ((symbol-function 'window-parameter)
- (lambda (window parameter)
- (and (eq parameter 'adob--dim)
- (memq window '(left right))))))
- (should (cj/auto-dim--vterm-buffer-dimmed-p)))))
-
-(ert-deftest test-auto-dim-config-vterm-dimmed-p-undimmed-window-keeps-buffer-bright ()
- "Normal: a selected/undimmed vterm window keeps the buffer bright."
- (skip-unless (file-directory-p test-auto-dim--fork))
- (require 'auto-dim-config)
- (let ((major-mode 'vterm-mode))
- (cl-letf (((symbol-function 'get-buffer-window-list)
- (lambda (&rest _) '(left right)))
- ((symbol-function 'window-parameter)
- (lambda (window parameter)
- (and (eq parameter 'adob--dim)
- (eq window 'right)))))
- (should-not (cj/auto-dim--vterm-buffer-dimmed-p)))))
-
-(ert-deftest test-auto-dim-config-vterm-get-color-dims-only-dimmed-vterm-buffers ()
- "Normal: vterm color advice dims only buffers marked dimmed."
- (skip-unless (file-directory-p test-auto-dim--fork))
- (require 'auto-dim-config)
- (let ((major-mode 'vterm-mode)
- (cj/auto-dim-vterm-foreground-blend 1.0))
- (cl-letf (((symbol-function 'cj/auto-dim--vterm-buffer-dimmed-p)
- (lambda () t))
- ((symbol-function 'cj/auto-dim--face-color)
- (lambda (&rest _) "#555555")))
- (should (equal "#555555"
- (cj/auto-dim--vterm-get-color
- (lambda (&rest _) "#ffffff") 7 :foreground))))
- (cl-letf (((symbol-function 'cj/auto-dim--vterm-buffer-dimmed-p)
- (lambda () nil)))
- (should (equal "#ffffff"
- (cj/auto-dim--vterm-get-color
- (lambda (&rest _) "#ffffff") 7 :foreground))))))
-
-(ert-deftest test-auto-dim-config-vterm-post-command-schedules-refresh-on-window-change ()
- "Normal: post-command vterm refresh schedules only after selection changes."
- (skip-unless (file-directory-p test-auto-dim--fork))
- (require 'auto-dim-config)
- (let ((cj/auto-dim--last-selected-window 'old)
- (calls 0))
- (cl-letf (((symbol-function 'selected-window)
- (lambda () 'new))
- ((symbol-function 'cj/auto-dim--schedule-vterm-refresh)
- (lambda (&optional _) (setq calls (1+ calls)))))
- (cj/auto-dim--refresh-vterm-on-command)
- (cj/auto-dim--refresh-vterm-on-command))
- (should (eq cj/auto-dim--last-selected-window 'new))
- (should (= calls 1))))
-
-(ert-deftest test-auto-dim-config-vterm-refresh-runs-auto-dim-before-invalidate ()
- "Normal: deferred vterm refresh updates auto-dim before invalidating vterm."
- (skip-unless (file-directory-p test-auto-dim--fork))
- (require 'auto-dim-config)
- (let (events)
- (cl-letf (((symbol-function 'adob--update)
- (lambda () (push 'adob events)))
- ((symbol-function 'cj/auto-dim--refresh-vterm-windows)
- (lambda (&optional _) (push 'vterm events))))
- (cj/auto-dim--refresh-vterm-after-auto-dim))
- (should (equal events '(vterm adob)))))
-
-(ert-deftest test-auto-dim-config-vterm-refresh-nudges-size-for-full-redraw ()
- "Normal: vterm refresh nudges size to force full-grid redraw."
- (skip-unless (file-directory-p test-auto-dim--fork))
- (require 'auto-dim-config)
- (let ((calls nil)
- (vterm-min-window-width 80))
- (with-temp-buffer
- (setq major-mode 'vterm-mode)
- (setq-local vterm--term 'term)
- (let ((buffer (current-buffer)))
- (cl-letf (((symbol-function 'window-list)
- (lambda (&rest _) '(vterm-window)))
- ((symbol-function 'window-buffer)
- (lambda (_) buffer))
- ((symbol-function 'window-live-p)
- (lambda (_) t))
- ((symbol-function 'window-body-height)
- (lambda (_) 24))
- ((symbol-function 'window-body-width)
- (lambda (_) 100))
- ((symbol-function 'vterm--get-margin-width)
- (lambda () 3))
- ((symbol-function 'vterm--set-size)
- (lambda (term height width)
- (push (list term height width) calls))))
- (cj/auto-dim--refresh-vterm-windows))))
- (should (equal (nreverse calls)
- '((term 25 97)
- (term 24 97))))))
-
(ert-deftest test-auto-dim-config-never-dim-dashboard-exempts-dashboard ()
"Normal: the *dashboard* buffer is exempt from dimming."
(skip-unless (file-directory-p test-auto-dim--fork))