From 4000330e5e6536f64f404c1cabc8dc86d9556bb5 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-vterm-tmux-history.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/test-vterm-tmux-history.el') diff --git a/tests/test-vterm-tmux-history.el b/tests/test-vterm-tmux-history.el index db82176f..901d96c9 100644 --- a/tests/test-vterm-tmux-history.el +++ b/tests/test-vterm-tmux-history.el @@ -164,13 +164,13 @@ modern keyboards and was redundant." "Normal: an AI-vterm-named buffer still resolves by process TTY. The copy path belongs to `vterm-mode', not to `*vterm*'-named buffers. -A buffer named like `claude [repo]' (ai-vterm.el's naming) is a +A buffer named like `agent [repo]' (ai-vterm.el's naming) is a `vterm-mode' buffer and must inherit tmux history copy. The pane lookup keys off the live process TTY, never the buffer name -- so the AI-vterm name neither helps nor blocks resolution." - (let ((claude (cj/test--make-fake-vterm-buffer "claude [emacs.d]"))) + (let ((agent (cj/test--make-fake-vterm-buffer "agent [emacs.d]"))) (unwind-protect - (with-current-buffer claude + (with-current-buffer agent (cl-letf (((symbol-function 'get-buffer-process) (lambda (_buffer) 'fake-process)) ((symbol-function 'process-tty-name) @@ -179,8 +179,8 @@ AI-vterm name neither helps nor blocks resolution." '((("list-clients" "-F" "#{client_tty}\t#{pane_id}") 0 "/dev/pts/1\t%1\n/dev/pts/8\t%8\n")) (should (equal (cj/vterm--current-tmux-pane-id) "%8"))))) - (when (buffer-live-p claude) - (kill-buffer claude))))) + (when (buffer-live-p agent) + (kill-buffer agent))))) (provide 'test-vterm-tmux-history) ;;; test-vterm-tmux-history.el ends here -- cgit v1.2.3