diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-11 07:18:20 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-11 07:18:20 -0500 |
| commit | 4000330e5e6536f64f404c1cabc8dc86d9556bb5 (patch) | |
| tree | bb0ad65fb1cb9b1dba629998fe2983a9a3020fa7 /tests/test-ai-vterm--display-rule.el | |
| parent | 56680633ea0e1b549fd7087c1f9d6d1abf9f0690 (diff) | |
| download | dotemacs-4000330e5e6536f64f404c1cabc8dc86d9556bb5.tar.gz dotemacs-4000330e5e6536f64f404c1cabc8dc86d9556bb5.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--display-rule.el')
| -rw-r--r-- | tests/test-ai-vterm--display-rule.el | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/test-ai-vterm--display-rule.el b/tests/test-ai-vterm--display-rule.el index af481eb3..15d270e2 100644 --- a/tests/test-ai-vterm--display-rule.el +++ b/tests/test-ai-vterm--display-rule.el @@ -2,7 +2,7 @@ ;;; Commentary: ;; The module installs a `display-buffer-alist' entry routing buffers -;; whose names match "\\`claude \\[" to a right-side window. These +;; whose names match "\\`agent \\[" to a right-side window. These ;; tests verify the rule reaches the right side and ignores buffers ;; that don't match the prefix. @@ -26,13 +26,13 @@ (let ((display-buffer-alist (cj/--ai-vterm-display-rule-list))) ,@body))) -(ert-deftest test-ai-vterm--display-rule-routes-claude-buffer-to-right () - "Normal: a buffer named \"claude [foo]\" lands in a window to the right. +(ert-deftest test-ai-vterm--display-rule-routes-agent-buffer-to-right () + "Normal: a buffer named \"agent [foo]\" lands in a window to the right. The rule uses `display-buffer-in-direction' with `(direction . right)', which splits the current window so the new window's left edge sits at a positive column. The buffer winds up in that new window." - (let ((name "claude [display-rule-test]")) + (let ((name "agent [display-rule-test]")) (test-ai-vterm--cleanup name) (unwind-protect (test-ai-vterm--with-clean-frame @@ -43,7 +43,7 @@ a positive column. The buffer winds up in that new window." (test-ai-vterm--cleanup name)))) (ert-deftest test-ai-vterm--display-rule-skips-non-matching-buffer () - "Boundary: a buffer not named \"claude [...]\" does not match the rule. + "Boundary: a buffer not named \"agent [...]\" does not match the rule. The rule's regex doesn't fire, so `display-buffer' falls back to the default action -- reuse the current window -- and no rightward split @@ -59,8 +59,8 @@ occurs." (test-ai-vterm--cleanup name)))) (ert-deftest test-ai-vterm--display-rule-prefix-not-substring () - "Boundary: \"foo claude [bar]\" does not match -- the rule anchors at start." - (let ((name "foo claude [substring-test]")) + "Boundary: \"foo agent [bar]\" does not match -- the rule anchors at start." + (let ((name "foo agent [substring-test]")) (test-ai-vterm--cleanup name) (unwind-protect (test-ai-vterm--with-clean-frame |
