[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/eat f047b2d283 1/3: Fix terminal color reporting in text t
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/eat f047b2d283 1/3: Fix terminal color reporting in text terminals |
Date: |
Fri, 9 Dec 2022 15:58:44 -0500 (EST) |
branch: elpa/eat
commit f047b2d283bebed2d7c5e576be66205cace0f13c
Author: Akib Azmain Turja <akib@disroot.org>
Commit: Akib Azmain Turja <akib@disroot.org>
Fix terminal color reporting in text terminals
* eat.el (eat--t-report-foreground-color): Fix foreground color
reporting in text terminals.
* eat.el (eat--t-report-background-color): Fix background color
reporting in text terminals.
---
eat.el | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/eat.el b/eat.el
index 52992f85e5..1a4d1e0d17 100644
--- a/eat.el
+++ b/eat.el
@@ -2377,7 +2377,10 @@ output."
"Report the current default foreground color to the client."
(funcall
(eat--t-term-input-fn eat--t-term) eat--t-term
- (let ((rgb (color-values (face-foreground 'default))))
+ (let ((rgb (or (color-values (face-foreground 'default))
+ ;; On terminals like TTYs the above returns nil.
+ ;; Terminals usually have a white foreground, so...
+ '(255 255 255))))
(format "\e]10;%04x/%04x/%04x\e\\"
(pop rgb) (pop rgb) (pop rgb)))))
@@ -2385,7 +2388,10 @@ output."
"Report the current default background color to the client."
(funcall
(eat--t-term-input-fn eat--t-term) eat--t-term
- (let ((rgb (color-values (face-background 'default))))
+ (let ((rgb (or (color-values (face-background 'default))
+ ;; On terminals like TTYs the above returns nil.
+ ;; Terminals usually have a black background, so...
+ '(0 0 0))))
(format "\e]11;%04x/%04x/%04x\e\\"
(pop rgb) (pop rgb) (pop rgb)))))