diff options
author | Timo Sirainen <cras@irssi.org> | 2002-03-10 14:22:59 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2002-03-10 14:22:59 +0000 |
commit | b67e363cde8e0e4ce49e6d3bfc6ba1cd4b2ca1fe (patch) | |
tree | 786ff04b8aa619308b7b508a6cf6f9853cd42e7a /src/fe-common | |
parent | 7c9ac989ff6b0088ef0e2369b34eb8d1e100aeda (diff) | |
download | irssi-b67e363cde8e0e4ce49e6d3bfc6ba1cd4b2ca1fe.zip |
Foreground ANSI colors weren't working
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2548 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common')
-rw-r--r-- | src/fe-common/core/formats.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/fe-common/core/formats.c b/src/fe-common/core/formats.c index 8991164a..d70bcc45 100644 --- a/src/fe-common/core/formats.c +++ b/src/fe-common/core/formats.c @@ -729,8 +729,10 @@ static const char *get_ansi_color(THEME_REC *theme, const char *str, flags |= GUI_PRINT_FLAG_REVERSE; break; default: - if (num >= 30 && num <= 37) + if (num >= 30 && num <= 37) { + if (fg == -1) fg = 0; fg = (fg & 0xf8) | ansitab[num-30]; + } if (num >= 40 && num <= 47) { if (bg == -1) bg = 0; bg = (bg & 0xf8) | ansitab[num-40]; @@ -875,8 +877,10 @@ char *strip_codes(const char *input) } } - if (*p == 27 && p[1] != '\0') + if (*p == 27 && p[1] != '\0') { + p++; p = get_ansi_color(current_theme, p, NULL, NULL, NULL); + } if (!IS_COLOR_CODE(*p)) *out++ = *p; |