aboutsummaryrefslogtreecommitdiff
path: root/tests/test-ai-vterm--launch-command.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-11 07:18:20 -0500
committerCraig Jennings <c@cjennings.net>2026-05-11 07:18:20 -0500
commit59b0854464ef29511a0d09f1e76fd1140e675833 (patch)
tree0c18aee463b4ff14f2fa6675e2cde6fc5f50bbdc /tests/test-ai-vterm--launch-command.el
parentde555fa8b48c5ed5f17c0a8db9de7ecb946aa75d (diff)
downloaddotemacs-59b0854464ef29511a0d09f1e76fd1140e675833.tar.gz
dotemacs-59b0854464ef29511a0d09f1e76fd1140e675833.zip
refactor(ai-vterm): rename Claude-specific names to a generic "agent"
I may add other terminal agents to this launcher (aider, an open-source LLM TUI), so the buffer prefix, the user knob, and the internal helpers shouldn't say "Claude". The module name (ai-vterm) and the `cj/ai-vterm-*` customs were already generic. This finishes the job: - buffer prefix `claude [<basename>]` -> `agent [<basename>]` (the `defconst` and the matching display-buffer-alist regex move together) - `cj/ai-vterm-claude-command` -> `cj/ai-vterm-agent-command` (the default still runs the `claude` CLI, with a docstring note on swapping it) - `cj/--ai-vterm-claude-buffers` / `-displayed-claude-window` / `-reuse-existing-claude` -> `-agent-*`, and their test files renamed to match - prose in the module commentary and docstrings, plus the matching test docstrings and buffer-name literals `vterm-config.el` hardcodes the same buffer prefix in `cj/--vterm-toggle-buffer-p` (F12 excludes agent buffers from its candidate set), so that literal moved too. Collapsing it into the shared `cj/--ai-vterm-name-prefix` is a cleanup for another day. After a reload, a project's buffer opens as `agent [foo]` instead of `claude [foo]`. Old buffers keep their names until killed. I also corrected two stale `eshell-vterm-config.el` references in ai-vterm.el docstrings (that module was split into `vterm-config.el`). Two things keep saying "Claude": the `cj/ai-vterm-agent-command` default value (the actual CLI), and the "Claude Code" example in `vterm-config.el`'s cursor-restore docstring (a concrete TUI example, not branding). 90 tests pass. `make validate-modules` clean.
Diffstat (limited to 'tests/test-ai-vterm--launch-command.el')
-rw-r--r--tests/test-ai-vterm--launch-command.el36
1 files changed, 18 insertions, 18 deletions
diff --git a/tests/test-ai-vterm--launch-command.el b/tests/test-ai-vterm--launch-command.el
index 17f02f02..7e455a8b 100644
--- a/tests/test-ai-vterm--launch-command.el
+++ b/tests/test-ai-vterm--launch-command.el
@@ -2,12 +2,12 @@
;;; Commentary:
;; The launch command is what gets typed into a fresh vterm shell to bring
-;; up Claude inside a per-project tmux session. The session is named
+;; 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 Claude rather than
+;; 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
-;; Claude exits, leaving the session intact for recovery.
+;; the agent exits, leaving the session intact for recovery.
;;; Code:
@@ -18,22 +18,22 @@
(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-claude-command "claude"))
+ (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-claude-command "claude")
+ (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 claude window is named distinctly."
- (let ((cj/ai-vterm-claude-command "claude")
+ "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 "
@@ -41,36 +41,36 @@
(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-claude-command "claude")
- (cj/ai-vterm-tmux-window-name "claude"))
+ (let ((cj/ai-vterm-agent-command "agent")
+ (cj/ai-vterm-tmux-window-name "agent"))
(should (string-match-p
- " -n claude "
+ " -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-claude-command "claude"))
+ (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-claude-command ()
- "Normal: the configured claude command is in the launched shell command."
- (let ((cj/ai-vterm-claude-command "claude --some-flag"))
+(ert-deftest test-ai-vterm--launch-command-includes-agent-command ()
+ "Normal: the configured agent command is in the launched shell command."
+ (let ((cj/ai-vterm-agent-command "agent --some-flag"))
(should (string-match-p
- "claude --some-flag"
+ "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 Claude exiting."
- (let ((cj/ai-vterm-claude-command "claude"))
+ "Boundary: `exec bash' tails so the tmux window survives the agent exiting."
+ (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-handles-spaces-in-basename ()
"Boundary: a basename with whitespace becomes hyphenated before quoting."
- (let ((cj/ai-vterm-claude-command "claude")
+ (let ((cj/ai-vterm-agent-command "agent")
(cj/ai-vterm-tmux-session-prefix "aiv-"))
(should (string-match-p
" -s aiv-my-work "