branch: elpa/aidermacs
commit 57cea2f1122477feb529bc8966056a919ffba228
Author: Troy Hinckley <t.mac...@gmail.com>
Commit: Troy Hinckley <t.mac...@gmail.com>

    Allow aider to match the users background in the vterm backend
---
 aidermacs-backend-vterm.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/aidermacs-backend-vterm.el b/aidermacs-backend-vterm.el
index cd224c24c8..cf482cafdd 100644
--- a/aidermacs-backend-vterm.el
+++ b/aidermacs-backend-vterm.el
@@ -12,7 +12,10 @@
   (unless (require 'vterm nil t)
     (error "vterm package is not available"))
   (unless (get-buffer buffer-name)
-    (let ((cmd (concat program " " (mapconcat 'identity args " "))))
+    (let ((mode (if (eq (frame-parameter nil 'background-mode) 'dark)
+                     "--dark-mode"
+                   "--light-mode"))
+           (cmd (mapconcat 'identity (append (list program mode) args) " ")))
       (setq vterm-shell cmd)
       (setq vterm-buffer-name buffer-name)
       (vterm)

Reply via email to