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--capture-state.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--capture-state.el')
| -rw-r--r-- | tests/test-ai-term--capture-state.el | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/tests/test-ai-term--capture-state.el b/tests/test-ai-term--capture-state.el new file mode 100644 index 00000000..543f83ad --- /dev/null +++ b/tests/test-ai-term--capture-state.el @@ -0,0 +1,63 @@ +;;; test-ai-term--capture-state.el --- Tests for cj/--ai-term-capture-state -*- lexical-binding: t; -*- + +;;; Commentary: +;; The capture helper writes WINDOW's direction and size to module- +;; level state vars `cj/--ai-term-last-direction' and +;; `cj/--ai-term-last-size'. Called from `cj/ai-term''s toggle-off +;; branch so the next F9 display can restore the user's chosen +;; orientation and size. No-op on a dead window. + +;;; Code: + +(require 'ert) + +(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory)) +(require 'ai-term) + +(ert-deftest test-ai-term--capture-state-right-split-sets-direction () + "Normal: right-split window -> direction=right, integer body-cols matching window." + (save-window-excursion + (delete-other-windows) + (let ((right (split-window (selected-window) nil 'right)) + (cj/--ai-term-last-direction nil) + (cj/--ai-term-last-size nil)) + (cj/--ai-term-capture-state right) + (should (eq cj/--ai-term-last-direction 'right)) + (should (integerp cj/--ai-term-last-size)) + (should (= cj/--ai-term-last-size (window-body-width right)))))) + +(ert-deftest test-ai-term--capture-state-below-split-sets-direction () + "Normal: below-split window -> direction=below, integer body-lines matching window." + (save-window-excursion + (delete-other-windows) + (let ((below (split-window (selected-window) nil 'below)) + (cj/--ai-term-last-direction nil) + (cj/--ai-term-last-size nil)) + (cj/--ai-term-capture-state below) + (should (eq cj/--ai-term-last-direction 'below)) + (should (integerp cj/--ai-term-last-size)) + (should (= cj/--ai-term-last-size (window-body-height below)))))) + +(ert-deftest test-ai-term--capture-state-noop-on-dead-window () + "Boundary: nil window -> state remains unchanged." + (let ((cj/--ai-term-last-direction 'sentinel-dir) + (cj/--ai-term-last-size 0.123)) + (cj/--ai-term-capture-state nil) + (should (eq cj/--ai-term-last-direction 'sentinel-dir)) + (should (= cj/--ai-term-last-size 0.123)))) + +(ert-deftest test-ai-term--capture-state-noop-on-deleted-window () + "Boundary: deleted window -> state remains unchanged." + (let ((cj/--ai-term-last-direction 'sentinel-dir) + (cj/--ai-term-last-size 0.123) + (dead-win (save-window-excursion + (delete-other-windows) + (let ((w (split-window (selected-window) nil 'right))) + (delete-window w) + w)))) + (cj/--ai-term-capture-state dead-win) + (should (eq cj/--ai-term-last-direction 'sentinel-dir)) + (should (= cj/--ai-term-last-size 0.123)))) + +(provide 'test-ai-term--capture-state) +;;; test-ai-term--capture-state.el ends here |
