diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2014-03-15 12:09:31 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2014-03-15 12:09:31 +0100 |
commit | 6749ed354d0671e5a60646b36b0a1cf573159124 (patch) | |
tree | 6c111b24e6d80b555b9bc9ded340fd4cb014dd17 | |
parent | 298f0211c1add0f451d77581319c1c696d1ba62e (diff) | |
download | weechat-6749ed354d0671e5a60646b36b0a1cf573159124.zip |
core: add decoding of bright ANSI colors (90-97, 100-107)
-rw-r--r-- | src/gui/gui-color.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/src/gui/gui-color.c b/src/gui/gui-color.c index e62f6bc24..a851b15da 100644 --- a/src/gui/gui-color.c +++ b/src/gui/gui-color.c @@ -102,8 +102,14 @@ int gui_color_term256[256] = /* ANSI colors */ regex_t *gui_color_regex_ansi = NULL; -char *gui_color_ansi[8] = -{ "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white" }; +char *gui_color_ansi[16] = +{ + /* 0-7 */ + "black", "red", "green", "brown", "blue", "magenta", "cyan", "gray", + /* 8-15 */ + "darkgray", "lightred", "lightgreen", "yellow", "lightblue", "lightmagenta", + "lightcyan", "white", +}; /* @@ -876,6 +882,30 @@ gui_color_decode_ansi_cb (void *data, const char *text) case 49: /* default background color */ strcat (output, gui_color_get_custom (",default")); break; + case 90: /* text color (bright) */ + case 91: + case 92: + case 93: + case 94: + case 95: + case 96: + case 97: + strcat (output, + gui_color_get_custom (gui_color_ansi[value - 90 + 8])); + break; + case 100: /* background color (bright) */ + case 101: + case 102: + case 103: + case 104: + case 105: + case 106: + case 107: + snprintf (str_color, sizeof (str_color), + "|,%s", + gui_color_ansi[value - 100 + 8]); + strcat (output, gui_color_get_custom (str_color)); + break; } } |