[systemd-commits] 2 commits - src/libsystemd-terminal
David Herrmann
dvdhrm at kemper.freedesktop.org
Sun Oct 5 06:50:56 PDT 2014
src/libsystemd-terminal/subterm.c | 5 +----
src/libsystemd-terminal/term-parser.c | 4 ++--
2 files changed, 3 insertions(+), 6 deletions(-)
New commits:
commit 34dbefceb1377ccd7871e183d7791f76fe879e73
Author: David Herrmann <dh.herrmann at gmail.com>
Date: Sun Oct 5 15:49:26 2014 +0200
terminal/screen: perform bold->light conversion only on foreground
Bold glyphs always use light colors. However, this color conversion is
limited to the foreground color, so skip it for backgrounds.
diff --git a/src/libsystemd-terminal/term-parser.c b/src/libsystemd-terminal/term-parser.c
index 8ec6345..d8206a4 100644
--- a/src/libsystemd-terminal/term-parser.c
+++ b/src/libsystemd-terminal/term-parser.c
@@ -100,8 +100,8 @@ static uint32_t term_color_to_argb32(const term_color *color, const term_attr *a
case TERM_CCODE_BLACK ... TERM_CCODE_LIGHT_WHITE:
t = color->ccode - TERM_CCODE_BLACK;
- /* bold causes light colors */
- if (t < 8 && attr->bold)
+ /* bold causes light colors (only for foreground colors) */
+ if (t < 8 && attr->bold && color == &attr->fg)
t += 8;
r = palette[t * 3 + 0];
commit 378c4eed029eb37eec31e56bd82ca5df2dee1e73
Author: David Herrmann <dh.herrmann at gmail.com>
Date: Sun Oct 5 15:48:32 2014 +0200
terminal/subterm: leave bold-light conversion to parent
We rely on the parent terminal to do color conversion, so also leave
bold->light conversion to the parent. Otherwise, it will be performed
twice and we might apply it on the wrong color.
diff --git a/src/libsystemd-terminal/subterm.c b/src/libsystemd-terminal/subterm.c
index dda6759..93c06be 100644
--- a/src/libsystemd-terminal/subterm.c
+++ b/src/libsystemd-terminal/subterm.c
@@ -428,10 +428,7 @@ static int output_draw_cell_fn(term_screen *screen,
output_printf(o, "\e[38;2;%u;%u;%um", attr->fg.red, attr->fg.green, attr->fg.blue);
break;
case TERM_CCODE_BLACK ... TERM_CCODE_WHITE:
- if (attr->bold)
- output_printf(o, "\e[%um", attr->fg.ccode - TERM_CCODE_BLACK + 90);
- else
- output_printf(o, "\e[%um", attr->fg.ccode - TERM_CCODE_BLACK + 30);
+ output_printf(o, "\e[%um", attr->fg.ccode - TERM_CCODE_BLACK + 30);
break;
case TERM_CCODE_LIGHT_BLACK ... TERM_CCODE_LIGHT_WHITE:
output_printf(o, "\e[%um", attr->fg.ccode - TERM_CCODE_LIGHT_BLACK + 90);
More information about the systemd-commits
mailing list