From 80f9815f5fdb61d5e554a8882ec8fad53a506d20 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Fri, 8 Jun 2018 00:00:00 -0500 Subject: [PATCH] top: a tweak to the recent 256-color termninal support We now use the actual terminfo 'max_colors' value with the 'color mapping' screen, not that hard coded '256'. Reference(s): https://gitlab.com/procps-ng/procps/issues/96 Signed-off-by: Jim Warner --- top/top.c | 2 +- top/top_nls.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/top/top.c b/top/top.c index ffb5568f..3d562280 100644 --- a/top/top.c +++ b/top/top.c @@ -3885,7 +3885,7 @@ signify_that: , CHKw(w, View_NOBOLD) ? N_txt(ON_word_only_txt) : N_txt(OFF_one_word_txt) , CHKw(w, Show_COLORS) ? N_txt(ON_word_only_txt) : N_txt(OFF_one_word_txt) , CHKw(w, Show_HIBOLD) ? N_txt(ON_word_only_txt) : N_txt(OFF_one_word_txt) - , tgt, clr, w->grpname)); + , tgt, max_colors, clr, w->grpname)); putp(Cap_clr_eos); fflush(stdout); diff --git a/top/top_nls.c b/top/top_nls.c index ab279720..036d93c0 100644 --- a/top/top_nls.c +++ b/top/top_nls.c @@ -630,7 +630,7 @@ static void build_uniq_nlstab (void) { " S~2 = Summary Data,~1 M~2 = Messages/Prompts,\n" " H~2 = Column Heads,~1 T~2 = Task Information\n" "2) Select a ~1color~2 as a number or use the up/down arrow keys\n" - " to raise/lower the 256 colors value, ~1current color~2 is ~1 %d ~4:\n" + " to raise/lower the %d colors value, ~1current color~2 is ~1 %d ~4:\n" " 0~2 = black,~1 1~2 = red, ~1 2~2 = green,~1 3~2 = yellow,\n" " 4~2 = blue, ~1 5~2 = magenta,~1 6~2 = cyan, ~1 7~2 = white\n" "\n"