aboutsummaryrefslogtreecommitdiff
path: root/modules/ai-term-backend-eat.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-02 09:43:55 -0400
committerCraig Jennings <c@cjennings.net>2026-07-02 09:43:55 -0400
commit4b53b52507faef662a8f670b4b80cbe24290de95 (patch)
treeabb6903c19336cf2e53f0aefb6ddc4c5b886a2f2 /modules/ai-term-backend-eat.el
parent8357eed1e4753b142cdda0e57e00260f2341443e (diff)
downloaddotemacs-4b53b52507faef662a8f670b4b80cbe24290de95.tar.gz
dotemacs-4b53b52507faef662a8f670b4b80cbe24290de95.zip
feat(ai-term): paint the agent accent dupre blue
Claude Code draws its accent (the bypass-permissions banner, borders, spinner) with xterm-256 palette codes, and the stock rose red is palette index 211. eat resolves those codes through a per-terminal face vector, so agent terminals now point index 211 at the new cj/ai-term-accent face (dupre blue #67809c) at creation. Every other eat terminal keeps the true palette. Per-project colors can later ride the same per-terminal mechanism.
Diffstat (limited to 'modules/ai-term-backend-eat.el')
-rw-r--r--modules/ai-term-backend-eat.el20
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/ai-term-backend-eat.el b/modules/ai-term-backend-eat.el
index 6d512831..82218ca7 100644
--- a/modules/ai-term-backend-eat.el
+++ b/modules/ai-term-backend-eat.el
@@ -25,9 +25,12 @@
(require 'ai-term-sessions)
(declare-function eat "eat" (&optional program arg))
+(declare-function eat-term-set-parameter "eat" (terminal parameter value))
(declare-function cj/ai-term-next "ai-term" ())
(defvar eat-buffer-name)
(defvar eat-semi-char-mode-map)
+(defvar eat-terminal)
+(defvar cj/ai-term-accent-color-indices)
(defun cj/--ai-term-send-string (buffer string)
"Send STRING to BUFFER's terminal process (the agent's shell).
@@ -36,6 +39,22 @@ Sends to the pty directly so the launch command reaches the shell EAT runs."
(when (process-live-p proc)
(process-send-string proc string))))
+(defun cj/--ai-term-apply-accent (buffer)
+ "Point BUFFER's terminal accent palette entries at `cj/ai-term-accent'.
+Repaints each index in `cj/ai-term-accent-color-indices' in this
+terminal's own 256-color palette (eat keeps one per terminal), so the
+agent's accent -- Claude Code's rose banner, borders, spinner -- renders
+in the accent face's color while every other eat terminal keeps the true
+palette. A no-op when BUFFER has no live eat terminal. Takes effect on
+the terminal's next redraw; text already on screen keeps its old color
+until the program repaints it (Claude Code's TUI repaints continuously)."
+ (with-current-buffer buffer
+ (when (bound-and-true-p eat-terminal)
+ (dolist (index cj/ai-term-accent-color-indices)
+ (eat-term-set-parameter eat-terminal
+ (intern (format "color-%d-face" index))
+ 'cj/ai-term-accent)))))
+
(defun cj/--ai-term-show-or-create (dir name)
"Show or create the AI-term buffer for project DIR with buffer NAME.
@@ -76,6 +95,7 @@ buffer."
(eat)))
(let ((buf (get-buffer name)))
(with-current-buffer buf
+ (cj/--ai-term-apply-accent buf)
(cj/--ai-term-send-string
buf (concat (cj/--ai-term-launch-command dir) "\n")))
(display-buffer buf)