Subject: Re: Getting TERM right
To: Bruce J.A. Nourish <bjan+netbsd-users@bjan.net>
From: Greg A. Woods <woods@weird.com>
List: netbsd-users
Date: 08/02/2003 13:10:31
[ On Saturday, August 2, 2003 at 01:42:00 (-0700), Bruce J.A. Nourish wrote: ]
> Subject: Getting TERM right
>
> I'd like to know the Right Thing to set my TERM variable to. Here's 
> what I've tried:

First of all you'll have to tell us exactly what terminal (or terminal
emulator) you're using.....

> vt100: no colors, pageup/pagedown & function keys don't work.

No vt100 ever had any colour display.  Not even vt102 or vt220 were
colour.  You must not be using a real vt100 if you expect colour!  ;-)

> ansi: color okay, but cursor is not addressed properly in vi.

The ansi termcap description is pretty minimal -- IIUC it's basically
vt100 without mentioning the DEC customisations.

> vt220: no color, function keys borked, pageup/pagedown work.

That's not too surprising.  vt220 keyboards are pretty wonky (at least
for anyone not accustomed to them) and again the real vt220 never had a
colour display.

> wsvt25: broken colors, pageup/pagedown work, function keys don't work.

Ah, I'm guessing you're trying to get the right TERM setting for your
system console (i386?) with the wscons display driver.

It's rather unfortunate that the wscons(4) device driver usurps the name
"vt100" to describe its bastardized terminal emulation since it's
clearly not a real vt100, and it doesn't even support the full vt100
emulation.  What would be really nice would be if wscons supported a
full ECMA-48 (i.e. ISO 6429) emulation and called it by one or both of
those names.

If indeed you are using an i386 system console then we need to know what
kernel options you've used (if any -- or are you running GENERIC?).  We
also need to know if you've made any changes to /etc/wscons.conf.

If everything's normal (i.e. default) then you should be using "wscons"
with the "vt100" emulation, which is really much closer to vt320.

The "wsvt25" or "wsvt25m" terminal types are supposed to be the closest
match to describing the actual wscons(5) emulator in its "vt100" mode.
This terminal description basically adds information about the
extensions of behaviour that wscons adds to a vt220.

I don't know why the "F1" function key wouldn't do what you expected.
The wsvt25 termcap entry expects "F1" to generate "\E[11~", which would
seem normal though many emulators, including xterm, send different
sequences for the first four function keys.  I don't have an i386 wscons
system anywhere within reach right now to test.....

> When I say "broken colors" for wsvt, I mean that colors with a black
> background were displayed fine, but those with a non-black background
> were simply shown as bright-white on black.

Over the years there's been some controversy over how colours should be
controlled on a character-based terminal....  ;-)

wscons(4) claims its "vt100" mode supports "ANSI colors" which you'd
think would be standard, but....  :-)

I'm guessing the real problem with colour handling is in mutt though.  I
don't, and I refuse to even try to, use Mutt though so I can't/won't
test it.  Mutt would have to know that the default background colour was
in order to be able to do anything sensible and it may very well be
assuming the background colour is black.  How are you switching the
background colour?

(BTW, if you want to read the actual ECMA-048 standard just go to
<URL:http://ecma-international.org/> and follow the links.  ECMA-048 is
equivalent to ISO/IEC 6429, but it's free.)

-- 
						Greg A. Woods

+1 416 218-0098                  VE3TCP            RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>          Secrets of the Weird <woods@weird.com>