From 59b0854464ef29511a0d09f1e76fd1140e675833 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 11 May 2026 07:18:20 -0500 Subject: 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 []` -> `agent []` (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. --- tests/test-ai-vterm--buffer-name.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests/test-ai-vterm--buffer-name.el') diff --git a/tests/test-ai-vterm--buffer-name.el b/tests/test-ai-vterm--buffer-name.el index 95c673ba7..2ebe91eea 100644 --- a/tests/test-ai-vterm--buffer-name.el +++ b/tests/test-ai-vterm--buffer-name.el @@ -2,7 +2,7 @@ ;;; Commentary: ;; Tests for the buffer-name transform. Given an absolute project -;; directory, the helper returns "claude []". The naming pattern +;; directory, the helper returns "agent []". The naming pattern ;; is what the display-buffer-alist rule keys on, so a regression here ;; silently breaks routing to the right side-window. @@ -14,29 +14,29 @@ (require 'ai-vterm) (ert-deftest test-ai-vterm--buffer-name-normal-project () - "Normal: a typical project path yields claude []." + "Normal: a typical project path yields agent []." (should (equal (cj/--ai-vterm-buffer-name "/home/cjennings/projects/foo") - "claude [foo]"))) + "agent [foo]"))) (ert-deftest test-ai-vterm--buffer-name-trailing-slash () "Boundary: trailing slash collapses before basename extraction." (should (equal (cj/--ai-vterm-buffer-name "/home/cjennings/projects/foo/") - "claude [foo]"))) + "agent [foo]"))) (ert-deftest test-ai-vterm--buffer-name-dot-prefix-dir () "Boundary: dot-prefix dirs (.emacs.d) preserve the dot in the basename." (should (equal (cj/--ai-vterm-buffer-name "/home/cjennings/.emacs.d") - "claude [.emacs.d]"))) + "agent [.emacs.d]"))) (ert-deftest test-ai-vterm--buffer-name-space-in-basename () "Boundary: a space in the basename round-trips into the buffer name." (should (equal (cj/--ai-vterm-buffer-name "/tmp/my work") - "claude [my work]"))) + "agent [my work]"))) (ert-deftest test-ai-vterm--buffer-name-deeply-nested () "Normal: only the last path component is used." (should (equal (cj/--ai-vterm-buffer-name "/a/b/c/d/e/leaf") - "claude [leaf]"))) + "agent [leaf]"))) (provide 'test-ai-vterm--buffer-name) ;;; test-ai-vterm--buffer-name.el ends here -- cgit v1.2.3