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 | 59b0854464ef29511a0d09f1e76fd1140e675833 (patch) | |
| tree | 0c18aee463b4ff14f2fa6675e2cde6fc5f50bbdc /modules/vterm-config.el | |
| parent | de555fa8b48c5ed5f17c0a8db9de7ecb946aa75d (diff) | |
| download | dotemacs-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 'modules/vterm-config.el')
| -rw-r--r-- | modules/vterm-config.el | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/modules/vterm-config.el b/modules/vterm-config.el index e601ab40..191d74e8 100644 --- a/modules/vterm-config.el +++ b/modules/vterm-config.el @@ -197,7 +197,7 @@ ai-vterm.el is loaded." ;; vterm-toggle is kept installed so `M-x vterm-toggle' still works, ;; but F12 below is bound to a custom toggle (`cj/vterm-toggle') that -;; excludes claude-prefixed buffers from its candidate set. +;; excludes agent-prefixed buffers from its candidate set. (use-package vterm-toggle :defer .5 :config @@ -207,11 +207,11 @@ ai-vterm.el is loaded." ;; ;; Replacement for `vterm-toggle' on F12. Two reasons to roll our own: ;; -;; 1. claude exclusion. vterm-toggle picks the most-recently-selected +;; 1. agent exclusion. vterm-toggle picks the most-recently-selected ;; vterm buffer as the toggle target. When the user just used F9 -;; on a claude vterm, the most-recent vterm IS claude, so F12 ends -;; up toggling claude -- which has its own F9 / C-F9 / M-F9 surface -;; in `ai-vterm.el' and shouldn't be affected by F12. The claude +;; on an agent vterm, the most-recent vterm IS agent, so F12 ends +;; up toggling agent -- which has its own F9 / C-F9 / M-F9 surface +;; in `ai-vterm.el' and shouldn't be affected by F12. The agent ;; exclusion lives in the candidate filter (`cj/--vterm-toggle-buffer-p'). ;; ;; 2. user-modified geometry. vterm-toggle's display rule had a @@ -245,7 +245,7 @@ nil means fall back to `cj/vterm-toggle-window-height' as a fraction.") Qualifies when BUFFER is alive, has `vterm-mode' (or its name starts with the vterm-toggle prefix), AND its name does NOT start with the -claude prefix used by ai-vterm.el. The claude exclusion keeps F12 +agent prefix used by ai-vterm.el. The agent exclusion keeps F12 from grabbing buffers that ai-vterm.el's F9 dispatch owns." (and (bufferp buffer) (buffer-live-p buffer) @@ -254,7 +254,7 @@ from grabbing buffers that ai-vterm.el's F9 dispatch owns." (string-prefix-p (or (bound-and-true-p vterm-buffer-name) "*vterm*") (buffer-name buffer))) - (not (string-prefix-p "claude [" (buffer-name buffer))))))) + (not (string-prefix-p "agent [" (buffer-name buffer))))))) (defun cj/--vterm-toggle-buffers () "Return live F12-managed vterm buffers in `buffer-list' (MRU) order." @@ -292,7 +292,7 @@ vars, falling back to `below' and `cj/vterm-toggle-window-height'." Routes any vterm buffer that satisfies `cj/--vterm-toggle-buffer-p' through two actions: reuse-window (for visible vterm windows) then -the saved-geometry display action. Excludes claude buffers via the +the saved-geometry display action. Excludes agent buffers via the predicate -- those are handled by ai-vterm.el's display rule." '(((lambda (buffer-or-name _) (cj/--vterm-toggle-buffer-p (get-buffer buffer-or-name))) @@ -322,7 +322,7 @@ Returns one of: (declare-function vterm "vterm" (&optional buffer-name)) (defun cj/vterm-toggle () - "Toggle a normal (non-claude) vterm buffer. + "Toggle a normal (non-agent) vterm buffer. - If an F12-managed vterm is currently displayed in this frame, capture its geometry and delete its window (toggle off). Falls @@ -333,7 +333,7 @@ Returns one of: - Otherwise, create a new vterm via `(vterm)' which routes through the same display action. -Excludes claude-prefixed vterm buffers; those have their own F9 / +Excludes agent-prefixed vterm buffers; those have their own F9 / C-F9 / M-F9 dispatch via `cj/ai-vterm'." (interactive) (pcase (cj/--vterm-toggle-dispatch) |
