From 23ea77be7651287283268f0d0caa30003038a41c Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Tue, 19 Jul 2016 07:19:41 -0700 Subject: [PATCH] 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 --- src/output.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/output.cpp b/src/output.cpp index 85f1f1b9c..af6fe24f2 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -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; }