<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dotemacs/tests/test-ai-vterm--launch-command.el, branch load-graph-classify-end</title>
<subtitle>My Emacs configuration
</subtitle>
<id>https://git.cjennings.net/dotemacs/atom?h=load-graph-classify-end</id>
<link rel='self' href='https://git.cjennings.net/dotemacs/atom?h=load-graph-classify-end'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/'/>
<updated>2026-05-16T09:01:04+00:00</updated>
<entry>
<title>refactor(integrations): five hygiene fixes from the module-by-module re-review</title>
<updated>2026-05-16T09:01:04+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-16T09:01:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=500687f8d7d5b87ceb33fd959e545746ec9db1ba'/>
<id>urn:sha1:500687f8d7d5b87ceb33fd959e545746ec9db1ba</id>
<content type='text'>
- markdown-config.el: two related fixes on `markdown-preview'.
  First, the URL was `https://localhost:8080/imp' but simple-httpd
  serves plaintext on port 8080 -- the browser hit a TLS handshake
  against a non-TLS listener and the preview never rendered.  Changed
  to `http://' and switched from `browse-url-generic' to plain
  `browse-url' so the user's default protocol handler picks the
  browser.  Second, the function used to start the network listener
  as a side effect of opening a preview; that's split into a
  separate `cj/markdown-preview-server-start' command and
  `markdown-preview' now signals a `user-error' (with the recovery
  command in the message) when the server isn't running.

- slack-config.el: wrap the
  `which-key-add-keymap-based-replacements' call in
  `with-eval-after-load 'which-key'.  Matches the pattern other
  config modules use and means a slow / missing which-key load
  won't block requiring slack-config.

- ai-vterm.el: pass the inner shell-command-string through
  `shell-quote-argument' before wrapping in the tmux invocation.
  The default value with embedded double quotes was safe under the
  prior literal-single-quote wrap, but a user-customized
  `cj/ai-vterm-agent-command' containing a single quote silently
  broke the shell parse.  Two existing tests updated to tolerate
  the post-quote escape shape; new regression test asserts a
  single-quote-bearing custom command survives.

- eshell-config.el: scope the `TERM=xterm-256color' override to
  eshell-spawned processes only via an `eshell-mode' hook that
  prepends to a buffer-local `process-environment'.  The previous
  global `setenv' at config-time changed `TERM' for every
  subsequent `start-process' across the Emacs session, so any
  subprocess (not just eshell pipelines) inherited
  `xterm-256color' regardless of whether the receiver could
  interpret the escapes.
</content>
</entry>
<entry>
<title>refactor(ai-vterm): rename Claude-specific names to a generic "agent"</title>
<updated>2026-05-11T12:18:20+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-11T12:18:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=59b0854464ef29511a0d09f1e76fd1140e675833'/>
<id>urn:sha1:59b0854464ef29511a0d09f1e76fd1140e675833</id>
<content type='text'>
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 [&lt;basename&gt;]` -&gt; `agent [&lt;basename&gt;]` (the `defconst` and the matching display-buffer-alist regex move together)
- `cj/ai-vterm-claude-command` -&gt; `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` -&gt; `-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.
</content>
</entry>
<entry>
<title>feat(ai-vterm): name the tmux session's first window "ai"</title>
<updated>2026-05-11T10:34:37+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-11T10:34:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=de555fa8b48c5ed5f17c0a8db9de7ecb946aa75d'/>
<id>urn:sha1:de555fa8b48c5ed5f17c0a8db9de7ecb946aa75d</id>
<content type='text'>
I pass `tmux new-session -n` so the window running the AI tool shows up as "ai" in the window list instead of auto-naming after the running program. A shell opened by hand in a later window still auto-names (e.g. "zsh"), so the two read distinctly. The name is a new `defcustom` (`cj/ai-vterm-tmux-window-name`), symmetric with the session-prefix custom.
</content>
</entry>
<entry>
<title>feat(ai-vterm): surface surviving tmux sessions in the project picker</title>
<updated>2026-05-11T10:17:44+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-11T10:17:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=ca7015486d230192e94c51c0e5d014fc83a7a35f'/>
<id>urn:sha1:ca7015486d230192e94c51c0e5d014fc83a7a35f</id>
<content type='text'>
Each project's tmux session is now named `&lt;cj/ai-vterm-tmux-session-prefix&gt;&lt;basename&gt;` (default `aiv-`), so `tmux ls` can be filtered to AI-vterm's own sessions. After an Emacs crash the C-F9 project picker reads `tmux list-sessions`, matches surviving sessions back to their directories, and sorts those to the top: `[detached]` when only the tmux session is alive, `[running]` when a vterm buffer exists. The rest follow alphabetically. With tmux missing or no server running, it falls back to a plain alphabetical list. The picker's collection is a completion table that pins display order so Vertico doesn't re-sort and undo the active-first grouping.

The prefix is a new `defcustom` rather than `claude-`, which collides with hand-rolled tmux sessions. Sessions named before this change use the bare basename and won't be matched afterward. One `tmux kill-server` clears any orphans.
</content>
</entry>
<entry>
<title>fix(ai-vterm): direction-based display + per-project tmux session names</title>
<updated>2026-05-08T03:09:15+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-08T03:09:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=1d93e1a6569e4193c2b078a3d5df0bf47eeba9df'/>
<id>urn:sha1:1d93e1a6569e4193c2b078a3d5df0bf47eeba9df</id>
<content type='text'>
Two post-ship issues blocked practical use of the new launcher.

The display rule used `display-buffer-in-side-window` with `(dedicated . t)`. Side-window dedication caused `set-window-buffer` to error during `buffer-move` (C-M-arrows), which left a half-finished swap with both sides showing the claude buffer. Then `switch-to-buffer` on a non-claude buffer in that dedicated window split instead of replacing.

I rewrote the rule as `display-buffer-reuse-window -&gt; display-buffer-use-some-window -&gt; display-buffer-in-direction (right)`. The resulting window is ordinary, not dedicated, so swap and replace work normally. I also narrowed `vterm-toggle`'s broad lambda (which matches any vterm-mode buffer) to exclude `claude [` buffers. Otherwise vterm-toggle's `:defer` made it install last and capture our buffers first with its own bottom-split + dedicated treatment.

The tmux side: vterm's auto-launch hook ran a bare `tmux\n`, so each session got an auto-named one. After an Emacs crash the tmux session would survive but I couldn't find it. A second F9 just spawned another. The launcher now sends `tmux new-session -A -s &lt;basename&gt; -c &lt;dir&gt; '&lt;claude&gt;; exec bash'`. The `-A` reattaches to a same-named session if it already exists. The `exec bash` keeps the tmux window alive if claude itself exits. A `cj/--ai-vterm-suppress-tmux` flag tells the existing vterm hook to skip its bare tmux step so the named launch runs instead.

11 new tests across 2 files cover the session-name and launch-command helpers. I updated tests for show-or-create and the display rule. All 34 ai-vterm tests are green.
</content>
</entry>
</feed>
