Subject: lib/21000: Colours swapped in ncurses-aware applications with some TERM settings
To: None <>
From: None <>
List: netbsd-bugs
Date: 04/03/2003 17:11:38
>Number:         21000
>Category:       lib
>Synopsis:       Colours swapped in ncurses-aware applications with some TERM settings
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 03 17:12:00 PST 2003
>Originator:     Per von Zweigbergk
>Release:        1.6
NetBSD  1.6 NetBSD 1.6 (GENERIC) #0: Sun Sep  8 19:43:40 UTC 2002 i386

With ncurses programs, the colours blue and red, as well as the colours cyan and brown are swapped, when the TERM variable is set to "linux", as it is when ssh-ing to a NetBSD machine from a Linux machine.
First, you have to break your terminal. Either do this by ssh-ing in from the Linux CONSOLE (not an xterm), and starting an ncurses-aware program. Lacking the Linux console, I have found that simply setenv TERM linux will do the trick when using an xterm or directly on the NetBSD console.

irssi is an excellent example of a program affected by this bug. The two bars at the top and the bottom of the program should be blue. (To quit irssi, type /quit).

Testing with "colorls -G" is misleading, since that program doesn't use terminfo/termcap to draw colours. Rather, it just sends control codes and hopes the remote terminal groks them. (Most do. :) Although running colorls under screen (setting TERM to linux before starting) turns the directories red. (This is because "screen" acts like a "filter" of sorts.)
I don't grok terminfo/termcap, but to work around the problem, you can "setenv TERM xterm" to fix the colours.