aboutsummaryrefslogtreecommitdiff
path: root/tests/test-ai-term--show-or-create.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-02 10:33:34 -0400
committerCraig Jennings <c@cjennings.net>2026-07-02 10:33:34 -0400
commit75cf36183811a1a9208baf6d75b56c274debebca (patch)
tree5b81eae8299a603cfc2c19fd416f456ca4e39121 /tests/test-ai-term--show-or-create.el
parent82b195278b551839314edf1bfab37d5f54c432cb (diff)
downloaddotemacs-75cf36183811a1a9208baf6d75b56c274debebca.tar.gz
dotemacs-75cf36183811a1a9208baf6d75b56c274debebca.zip
feat(ai-term): auto-set each project's session color on fresh launch
Every project now maps to a stable Claude Code session color: an override alist wins, else a character-sum hash of the project basename picks one of the eight names. When a fresh tmux session is created (never on reattach), a poller waits for the TUI to boot and types /color <name> itself, with the Enter deferred a beat so the slash-command menu can't swallow it. Two refusals keep the injection safe: the bypass banner must be on screen (a bare shell never gets typed into) and the prompt line must still be empty (typed-ahead input is never corrupted).
Diffstat (limited to 'tests/test-ai-term--show-or-create.el')
-rw-r--r--tests/test-ai-term--show-or-create.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test-ai-term--show-or-create.el b/tests/test-ai-term--show-or-create.el
index 4f5f1f67..9574b8a6 100644
--- a/tests/test-ai-term--show-or-create.el
+++ b/tests/test-ai-term--show-or-create.el
@@ -44,7 +44,13 @@ mirroring the real entry point."
(push (buffer-name b) ,calls)
b)))
((symbol-function 'cj/--ai-term-send-string)
- (lambda (_buf s) (push s ,strings))))
+ (lambda (_buf s) (push s ,strings)))
+ ;; Keep the create path hermetic: no tmux subprocess for the
+ ;; fresh-session check, no real /color poll timer.
+ ((symbol-function 'cj/--ai-term-live-tmux-sessions)
+ (lambda () nil))
+ ((symbol-function 'cj/--ai-term-schedule-color)
+ (lambda (_buffer _color) nil)))
,@body))))
(defun test-ai-term--cleanup (name)