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-term-toggle--display.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-term-toggle--display.el')
| -rw-r--r-- | tests/test-term-toggle--display.el | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/tests/test-term-toggle--display.el b/tests/test-term-toggle--display.el new file mode 100644 index 00000000..0943a488 --- /dev/null +++ b/tests/test-term-toggle--display.el @@ -0,0 +1,87 @@ +;;; test-term-toggle--display.el --- Tests for the F12 display-saved action -*- lexical-binding: t; -*- + +;;; Commentary: +;; Covers the F12-side equivalents of the ai-term display tests: +;; geometry capture (window-direction, window-size with 'below +;; default), capture-state writing module-level vars, and the custom +;; display action mapping cardinal -> edge directions. Tests stub +;; `display-buffer-in-direction' to capture the alist that would +;; have reached it. + +;;; Code: + +(require 'ert) +(require 'cl-lib) + +(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) +(require 'term-config) + +(ert-deftest test-term-toggle--capture-state-records-direction-and-size () + "Normal: capture-state writes direction and integer body size." + (save-window-excursion + (delete-other-windows) + (let ((below (split-window (selected-window) nil 'below)) + (cj/--term-toggle-last-direction nil) + (cj/--term-toggle-last-size nil)) + (cj/--term-toggle-capture-state below) + (should (eq cj/--term-toggle-last-direction 'below)) + (should (integerp cj/--term-toggle-last-size)) + (should (= cj/--term-toggle-last-size (window-body-height below)))))) + +(ert-deftest test-term-toggle--capture-state-noop-on-dead-window () + "Boundary: nil window -> state remains unchanged." + (let ((cj/--term-toggle-last-direction 'sentinel) + (cj/--term-toggle-last-size 0.123)) + (cj/--term-toggle-capture-state nil) + (should (eq cj/--term-toggle-last-direction 'sentinel)) + (should (= cj/--term-toggle-last-size 0.123)))) + +(ert-deftest test-term-toggle--display-saved-defaults-when-state-nil () + "Normal: nil state -> direction=bottom, size=cj/term-toggle-window-height." + (let (received-alist + (cj/--term-toggle-last-direction nil) + (cj/--term-toggle-last-size nil) + (cj/term-toggle-window-height 0.7)) + (cl-letf (((symbol-function 'display-buffer-in-direction) + (lambda (_b a) (setq received-alist a) 'fake-window))) + (cj/--term-toggle-display-saved 'fake-buf '((inhibit-same-window . t)))) + (should (eq (cdr (assq 'direction received-alist)) 'bottom)) + (should (= (cdr (assq 'window-height received-alist)) 0.7)) + (should (eq (cdr (assq 'inhibit-same-window received-alist)) t)))) + +(ert-deftest test-term-toggle--display-saved-maps-cardinal-to-edge () + "Normal: saved 'below maps to bottom edge; integer size wraps in body-lines." + (let (received-alist + (cj/--term-toggle-last-direction 'below) + (cj/--term-toggle-last-size 12)) + (cl-letf (((symbol-function 'display-buffer-in-direction) + (lambda (_b a) (setq received-alist a) 'fake-window))) + (cj/--term-toggle-display-saved 'fake-buf nil)) + (should (eq (cdr (assq 'direction received-alist)) 'bottom)) + (should (equal (cdr (assq 'window-height received-alist)) + '(body-lines . 12))) + (should-not (assq 'window-width received-alist)))) + +(ert-deftest test-term-toggle--display-saved-strips-conflicting-alist-entries () + "Boundary: caller-supplied direction/size are stripped, saved values win." + (let (received-alist + (cj/--term-toggle-last-direction 'right) + (cj/--term-toggle-last-size 30)) + (cl-letf (((symbol-function 'display-buffer-in-direction) + (lambda (_b a) (setq received-alist a) 'fake-window))) + (cj/--term-toggle-display-saved + 'fake-buf + '((direction . above) + (window-width . 0.2) + (window-height . 0.3) + (inhibit-same-window . t)))) + (should (eq (cdr (assq 'direction received-alist)) 'rightmost)) + (should (equal (cdr (assq 'window-width received-alist)) + '(body-columns . 30))) + (let ((wh-cells (cl-remove-if-not + (lambda (cell) (eq (car-safe cell) 'window-height)) + received-alist))) + (should (null wh-cells))))) + +(provide 'test-term-toggle--display) +;;; test-term-toggle--display.el ends here |
