aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-08-21 16:54:12 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-08-21 16:54:12 +0000
commit675504308a44274a5cc606abbb299fc439aa4589 (patch)
tree5a9fa4bef5832d60cb1d616e5ede36a6822035c4
parentterm: rename colors256 -> table (diff)
osc: add debug logs when colors are changed and reset
-rw-r--r--osc.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/osc.c b/osc.c
index b2f8159e..6b6f0d76 100644
--- a/osc.c
+++ b/osc.c
@@ -307,6 +307,7 @@ osc_dispatch(struct terminal *term)
if (!parse_rgb(string, &color))
break;
+ LOG_DBG("change color definition for #%u to %06x", idx, color);
term->colors.table[idx] = color;
render_refresh(term);
break;
@@ -340,6 +341,9 @@ osc_dispatch(struct terminal *term)
if (!parse_rgb(string, &color))
break;
+ LOG_DBG("change color definition for %s to %06x",
+ param == 10 ? "foreground" : "background", color);
+
switch (param) {
case 10: term->colors.fg = color; break;
case 11: term->colors.bg = color; break;
@@ -363,6 +367,7 @@ osc_dispatch(struct terminal *term)
/* Reset Color Number 'c' (whole table if no parameter) */
if (strlen(string) == 0) {
+ LOG_DBG("resetting all colors");
for (size_t i = 0; i < 256; i++)
term->colors.table[i] = term->colors.default_table[i];
} else {
@@ -371,6 +376,7 @@ osc_dispatch(struct terminal *term)
for (; *string != '\0'; string++) {
char c = *string;
if (c == ';') {
+ LOG_DBG("resetting color #%u", idx);
term->colors.table[idx] = term->colors.default_table[idx];
idx = 0;
continue;
@@ -380,6 +386,7 @@ osc_dispatch(struct terminal *term)
idx += c - '0';
}
+ LOG_DBG("resetting color #%u", idx);
term->colors.table[idx] = term->colors.default_table[idx];
}
@@ -391,11 +398,13 @@ osc_dispatch(struct terminal *term)
break;
case 110: /* Reset default text foreground color */
+ LOG_DBG("resetting foreground");
term->colors.fg = term->colors.default_fg;
render_refresh(term);
break;
- case 111: /* Reset default text backgroundc color */
+ case 111: /* Reset default text background color */
+ LOG_DBG("resetting background");
term->colors.bg = term->colors.default_bg;
render_refresh(term);
break;