aboutsummaryrefslogtreecommitdiff
path: root/tests/test-ai-vterm--launch-command.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-ai-vterm--launch-command.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-ai-vterm--launch-command.el')
-rw-r--r--tests/test-ai-vterm--launch-command.el94
1 files changed, 0 insertions, 94 deletions
diff --git a/tests/test-ai-vterm--launch-command.el b/tests/test-ai-vterm--launch-command.el
deleted file mode 100644
index bac36d4e..00000000
--- a/tests/test-ai-vterm--launch-command.el
+++ /dev/null
@@ -1,94 +0,0 @@
-;;; test-ai-vterm--launch-command.el --- Tests for cj/--ai-vterm-launch-command -*- lexical-binding: t; -*-
-
-;;; Commentary:
-;; The launch command is what gets typed into a fresh vterm shell to bring
-;; up the agent inside a per-project tmux session. The session is named
-;; `cj/ai-vterm-tmux-session-prefix' + the project basename, so a second
-;; F9 on the same project reattaches to the running agent rather than
-;; spawning a new one, and `tmux ls' output can be filtered to AI-vterm's
-;; own sessions. The trailing `exec bash' keeps the tmux window alive if
-;; the agent exits, leaving the session intact for recovery.
-
-;;; Code:
-
-(require 'ert)
-
-(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory))
-(require 'ai-vterm)
-
-(ert-deftest test-ai-vterm--launch-command-uses-new-session-attach ()
- "Normal: starts with `tmux new-session -A' so existing sessions reattach."
- (let ((cj/ai-vterm-agent-command "agent"))
- (should (string-prefix-p
- "tmux new-session -A "
- (cj/--ai-vterm-launch-command "/code/foo")))))
-
-(ert-deftest test-ai-vterm--launch-command-includes-prefixed-session-name ()
- "Normal: the session name is the prefixed form from the name helper."
- (let ((cj/ai-vterm-agent-command "agent")
- (cj/ai-vterm-tmux-session-prefix "aiv-"))
- (should (string-match-p
- " -s aiv-foo "
- (cj/--ai-vterm-launch-command "/code/foo")))))
-
-(ert-deftest test-ai-vterm--launch-command-names-window ()
- "Normal: `-n <window-name>' so the agent window is named distinctly."
- (let ((cj/ai-vterm-agent-command "agent")
- (cj/ai-vterm-tmux-window-name "ai"))
- (should (string-match-p
- " -n ai "
- (cj/--ai-vterm-launch-command "/code/foo")))))
-
-(ert-deftest test-ai-vterm--launch-command-honors-custom-window-name ()
- "Boundary: a non-default window name is what `-n' gets."
- (let ((cj/ai-vterm-agent-command "agent")
- (cj/ai-vterm-tmux-window-name "agent"))
- (should (string-match-p
- " -n agent "
- (cj/--ai-vterm-launch-command "/code/foo")))))
-
-(ert-deftest test-ai-vterm--launch-command-includes-start-directory ()
- "Normal: `-c <dir>' so the new session's first window starts in DIR."
- (let ((cj/ai-vterm-agent-command "agent"))
- (should (string-match-p
- " -c /code/foo "
- (cj/--ai-vterm-launch-command "/code/foo")))))
-
-(ert-deftest test-ai-vterm--launch-command-includes-agent-command ()
- "Normal: the configured agent command is in the launched shell command.
-The inner command is passed through `shell-quote-argument', so spaces
-are escaped (`\\\\ ') -- the regex below accepts either form."
- (let ((cj/ai-vterm-agent-command "agent --some-flag"))
- (should (string-match-p
- "agent\\(\\\\\\)? --some-flag"
- (cj/--ai-vterm-launch-command "/code/foo")))))
-
-(ert-deftest test-ai-vterm--launch-command-tails-with-exec-bash ()
- "Boundary: `exec bash' tails so the tmux window survives the agent exiting.
-Accepts the post-`shell-quote-argument' shape (`exec\\\\ bash')."
- (let ((cj/ai-vterm-agent-command "agent"))
- (should (string-match-p
- "exec\\(\\\\\\)? bash"
- (cj/--ai-vterm-launch-command "/code/foo")))))
-
-(ert-deftest test-ai-vterm--launch-command-survives-single-quote-in-agent ()
- "Normal: a user-customized agent command containing a single quote
-shouldn't break the shell parse. `shell-quote-argument' produces a
-valid shell token regardless of the embedded quote shape -- the
-escaping is implementation-detail, so we assert the literal words
-\"hi\" and \"there\" both appear (the space between them may be
-escaped as \\\\ )."
- (let ((cj/ai-vterm-agent-command "agent --say 'hi there'"))
- (let ((cmd (cj/--ai-vterm-launch-command "/code/foo")))
- (should (string-match-p "hi\\(\\\\\\)? there" cmd)))))
-
-(ert-deftest test-ai-vterm--launch-command-handles-spaces-in-basename ()
- "Boundary: a basename with whitespace becomes hyphenated before quoting."
- (let ((cj/ai-vterm-agent-command "agent")
- (cj/ai-vterm-tmux-session-prefix "aiv-"))
- (should (string-match-p
- " -s aiv-my-work "
- (cj/--ai-vterm-launch-command "/code/my work")))))
-
-(provide 'test-ai-vterm--launch-command)
-;;; test-ai-vterm--launch-command.el ends here