Subject: Re: Getting TERM right
To: NetBSD User's Discussion List <netbsd-users@netbsd.org>
From: Bruce J.A. Nourish <bjan+netbsd-users@bjan.net>
List: netbsd-users
Date: 08/02/2003 05:22:06
On Sat, Aug 02, 2003 at 01:10:31PM -0400, Greg A. Woods wrote:
> [ 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.....

As you guessed later, wscons on a vga card. To tell the truth, I've never
heard of anyone using anything different (except when working over a
serial port with a modem or null-modem cable). In fact, I've never even
seen a "terminal," except in a picture of the PDP that UNIX was written 
(with a well bearded dmr sitting in front). I guess I'm a bit young for
that :-).

> > 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!  ;-)

I figured vt100 had no color, but I find the whole termcap system
rather arcane and slightly confusing: so I was bieng throrough.

> > 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.

Thanks for the info, would not have found out in 100 years...

> > 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.

Yup. I got wsvt25 by grep'ing termcap for NetBSD. It would be nice if
the NetBSD docs would actually mention it...

> 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.

Agreed.

> 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.

I'm running current, with a well-modified kernel conf. I didn't change
any of the wscons related options. I haven't fiddled with 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.

Yep.

> 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. 

Any particular reason? Are you a cat person?

> 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?

mutt uses the system curses library to do the drawing. You'd probably
know more about libcurses than I. My default background color is black
(I don't even know if that could be changed.)

-- 
Bruce J.A. Nourish <bjan+JUNK@bjan.net>