[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lynx-dev Lynx vs. color-pairs?

From: Thomas Dickey
Subject: Re: lynx-dev Lynx vs. color-pairs?
Date: Fri, 13 Sep 2002 06:08:47 -0400
User-agent: Mutt/1.3.27i

On Thu, Sep 12, 2002 at 08:00:29PM -0700, Bela Lubkin wrote:
> I'm trying to understand some odd Lynx output with SCO OpenServer curses
> and the "ansi" terminfo entry.  The entry reads:
> =============================================================================
> #     Reconstructed via infocmp from file: /usr/lib/terminfo/a/ansi
> ansi|ansic|ansi-437|ansi80x25|Ansi standard console,
>       am, bce, eo, xon,
>       colors#8, cols#80, it#8, lines#25, pairs#64,
>       op=\E[37;40m, rev=\E[7m, ri=\E[T, rmacs=\E[10m,
>       rmso=\E[m, rmul=\E[m, setb=\E[4%p1%dm,
>       setf=\E[3%p1%dm, sgr0=\E[10;0m, smacs=\E[12m,
>       smso=\E[7m, smul=\E[4m,
> =============================================================================
> With this entry, Lynx outputs what appears to be an entire screen's
> worth of blank spaces at startup.  It also outputs big wads of spaces at
> other times.

It shouldn't.  The 'bce' is a hint to curses that clearing (generally
ED erase-display and EL erase-line) retains the current colors.
> An entry that reads "ansi-nopairs|testing, pairs@, use=ansi," eliminates
> this extra output.  So the problem is somehow related to "pairs=64".
> In fact, it seems to happen with any value of "pairs" larger than 8.
> Also, arbitrarily adding "pairs#9" to any other random terminfo entry
> causes the same behavior.

That's odd.  I don't think I've seen Solaris curses do this, but have
noticed that dtterm's 'pairs' value is given as 8, which doesn't reflect
the emulator's capabilities.  (In ncurses we changed it to 64).
It's possible that is related - that someone found it didn't work well
for some flavor of curses.
> I think this is related to this macro in LYCurses.c:
>   #define COLOR_BKGD ((COLOR_PAIRS >= 9) ? COLOR_PAIR(9) : A_NORMAL)

Possibly.  The '9' here is related to the way lynx builds color pairs.
See this chunk around line 650 in lynx_map_color:

    lynx_color_pairs[n+1].fg = lynx_color_cfg[n].fg;
    lynx_color_pairs[n+1].bg = lynx_color_cfg[n].bg;

    lynx_color_pairs[n+9].fg = lynx_color_cfg[n].fg;
    lynx_color_pairs[n+9].bg = lynx_color_cfg[0].bg;

    lynx_color_pairs[n+17].fg = lynx_color_cfg[n].bg;
    lynx_color_pairs[n+17].bg = lynx_color_cfg[n].bg;

It looks odd, but the intent was to make the colors behave the same way in
curses as in slang.
> and the calls to:
>   wbkgd(LYwin, COLOR_BKGD | ' ');

I guess you're talking about the space (' ').  If I don't add that, then
Solaris tends to eliminate the corresponding cells (sends a null).  I don't
recall looking to see what OpenServer did in this case.  At the time I was
debugging this, of course, I was testing Solaris on a dialin, and could
also see the effect of a mismatched 'bce' quite easily.  Now I tend to use
'script' to see what's going on.
> in lynx_map_color() and lynx_init_colors().  In fact I think I could
> kludge a "fix" in several different ways... what I don't know is how to
> fix it _right_.  I figure Tom will know, since he maintains both Lynx
> and the main implementation of curses...
> The right answer might be "OpenServer curses' wbkgd() is busted, it
> should know to emit ESC[2J to `clear' the screen to a particular color
> set rather than painting it with spaces".  But I hope not, that'll be a
> pain to fix...

But without wbkgd, things don't look very good, either.
> Lynx is:
>   $ lynx -version
>   Lynx Version 2.8.5dev.8 (28 May 2002)
>   libwww-FM 2.14, SSL-MM 1.4.1, OpenSSL 0.9.6b
>   Built on sco3.2v5.0.7 Jul 25 2002 03:57:05

I still have the 5.0.5 for testing (and the sdk from, I guess, Unixware).
So it's possible for me to do some comparisons.
> Using SCO OpenServer curses.  (yes, OpenSSL is dangerously out of date
> and will be updated before 5.0.7 ships...)
> >Bela<
> ; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

Thomas E. Dickey <address@hidden>

; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]