From de555fa8b48c5ed5f17c0a8db9de7ecb946aa75d Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 11 May 2026 05:34:37 -0500 Subject: feat(ai-vterm): name the tmux session's first window "ai" 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. --- tests/test-ai-vterm--launch-command.el | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/test-ai-vterm--launch-command.el') diff --git a/tests/test-ai-vterm--launch-command.el b/tests/test-ai-vterm--launch-command.el index 464c88b6..17f02f02 100644 --- a/tests/test-ai-vterm--launch-command.el +++ b/tests/test-ai-vterm--launch-command.el @@ -31,6 +31,22 @@ " -s aiv-foo " (cj/--ai-vterm-launch-command "/code/foo"))))) +(ert-deftest test-ai-vterm--launch-command-names-window () + "Normal: `-n ' so the claude window is named distinctly." + (let ((cj/ai-vterm-claude-command "claude") + (cj/ai-vterm-tmux-window-name "ai")) + (should (string-match-p + " -n ai " + (cj/--ai-vterm-launch-command "/code/foo"))))) + +(ert-deftest test-ai-vterm--launch-command-honors-custom-window-name () + "Boundary: a non-default window name is what `-n' gets." + (let ((cj/ai-vterm-claude-command "claude") + (cj/ai-vterm-tmux-window-name "claude")) + (should (string-match-p + " -n claude " + (cj/--ai-vterm-launch-command "/code/foo"))))) + (ert-deftest test-ai-vterm--launch-command-includes-start-directory () "Normal: `-c ' so the new session's first window starts in DIR." (let ((cj/ai-vterm-claude-command "claude")) -- cgit v1.2.3