Fix term256 w/ max_colors=256 sans xterm/-256color

We were effectively inferring 256 color support **only**.
If terminfo reports 256 max_colors for this $TERM but
that is not named xterm or does not contain "256color" in name,
term256_support_is_native()'s result did not affect the recorded
support.

Noticed with Terminal.app set to nsterm, and a newer ncurses
with good terminfo for the terminal on modern OS X:

http://invisible-island.net/ncurses/terminfo.src.html#toc-_Apple__Terminal_app
This commit is contained in:
Aaron Gyes
2016-07-19 07:19:41 -07:00
parent 51e25e5a8d
commit 23ea77be76

View File

@@ -47,7 +47,10 @@ int (*output_get_writer())(char) { return out; }
// Returns true if we think the term256 support is "native" as opposed to forced.
static bool term256_support_is_native(void) { return max_colors >= 256; }
color_support_t output_get_color_support(void) { return color_support; }
color_support_t output_get_color_support(void) {
if (term256_support_is_native()) { return color_support_term256 | color_support; }
return color_support;
}
void output_set_color_support(color_support_t val) { color_support = val; }