Ticket #152 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

minor display bug with -T and TERMINFO

Reported by: alain Owned by: josephpiche
Priority: lowest Milestone: 3.7.12
Component: source Version:
Severity: trivial Keywords:
Cc: patch: no

Description

Viewing the attached screenshot may help ;-)

With -T, in a white foreground xterm (or konsole or rxvt), after the first stone on the board, the foreground color is not reset to original value (black) but instead is light-grey.

In gg_utils, this correspond to the fputs (line 159)

void 
write_color_char_no_space(int c, int x)
{
#ifdef TERMINFO

  fprintf(stderr, "%s%c", tparm(setaf, c, 0, 0, 0, 0, 0, 0, 0, 0), x);
  fputs(tparm(setaf, max_color, 0, 0, 0, 0, 0, 0, 0, 0), stderr);

#elif 

Attachments

display-Tbug.png Download (2.4 KB) - added by alain 4 years ago.
screnshot
remove-ncurses.patch Download (5.5 KB) - added by josephpiche 3 years ago.
potential fix
fix-terminfo.patch Download (1.1 KB) - added by josephpiche 3 years ago.
A better patch that actually fixes the terminfo code

Regression Results

Attachment Rev. PASS FAIL Nodes Status
fix-terminfo.patch Download never tested
remove-ncurses.patch Download never tested

Change History

Changed 4 years ago by alain

screnshot

follow-up: ↓ 2   Changed 4 years ago by gunnar

I'm kind of more inclined to remove the colored displays altogether, but if someone actually uses them I suppose they could stay.

I don't know anything about terminfo. Is it max_color that happens to indicate light-gray and is there any more appropriate value?

in reply to: ↑ 1   Changed 4 years ago by nando

Replying to gunnar:

I'm kind of more inclined to remove the colored displays altogether, but if someone actually uses them I suppose they could stay.

FWIW, I do, quite often actually.

in reply to: ↑ description   Changed 3 years ago by josephpiche

  • owner changed from gnugo to josephpiche
  • status changed from new to assigned

I am also in favor of keeping the colors. After looking at the source of utils/gg_utils.c and compiling gnugo with config options TERMINFO 0 and ANSI_COLOR 1, it still occurs.

  Changed 3 years ago by josephpiche

My mistake, the ansi color does work. Compiling with "--without-curses" and "--enable-color" gives a working -T on a white background.

One possible solution is to disable ncurses altogether and only use ansi color. I see no problem with this, as it also would remove a dependency of compiling gnugo, but if someone has some objection to this I can continue to look at it and try to fix it.

  Changed 3 years ago by gunnar

We once had a debugboard utility using ncurses but it has long been retired and eventually completely removed. But ncurses use for colors predated that utility so I assume it was introduced specifically to support colored displays.

I'm all for removing the ncurses dependency if it's not needed.

Changed 3 years ago by josephpiche

potential fix

in reply to: ↑ description   Changed 3 years ago by josephpiche

I haven't done many patches before, so I'm not quite sure if this will work. Plus, I excluded changes to files make by autoconf, as I'm not sure I have the right version or am running the command correctly.

Changed 3 years ago by josephpiche

A better patch that actually fixes the terminfo code

  Changed 3 years ago by gunnar

  • status changed from assigned to closed
  • resolution set to fixed
  • milestone changed from 3.8 to 3.7.12

The patch looks very good. I've added it to CVS now.

Note: See TracTickets for help on using tickets.