Subject: Re: CVS commit: src/lib/libcurses
To: Julian Coleman <>
From: Alan Barrett <>
List: tech-userlevel
Date: 04/06/2003 10:11:11
[moving from source-changes to tech-userlevel]

On Sun, 06 Apr 2003, Julian Coleman wrote:
> Modified Files:
> 	src/lib/libcurses: color.c
> Log Message:
> Swap red/blue and yellow/cyan when working with Sb/Sf colour.  Problem
> noticed when working on PR 21000.

Are you sure that swapping them in libcurses is the right thing, as
opposed to swapping them via termcap/terminfo entries?

In other words, where is the specification of the API for the terminfo
setb/setf capabilities, or for the termcap Sb/Sf capabilities, and what
does the specification say?  Without checking the specification, it's
impossible to say whether the library was out of conformance, or whether
the termcap/terminfo database simply was not an accurate description
of the terminal's behaviour.

If you look at the terminfo man page (supplied by pkgsrc/devel/ncurses),
there's an example for the "ansi" terminal type that includes the following:


That means:

    emit "\E[4"
    if p1 == 1 then emit "4"
    elseif p1 == 3 then emit "6"
    elseif p1 == 4 then emit "1"
    elseif p1 == 6 then emit "3"
    else emit p1 as a decimal number
    emit "m"

The existence of this example strongly suggests to me that the colours
are supposed to be swapped in the termcap/terminfo description, not in
the curses library.  But I haven't seen a specification, so I don't

--apb (Alan Barrett)