Subject: Re: pkg_select defective?
To: Jan Danielsson <jan.danielsson@gmail.com>
From: Thomas Dickey <dickey@his.com>
List: netbsd-users
Date: 10/03/2006 16:15:03
On Tue, 3 Oct 2006, Jan Danielsson wrote:

> Rhialto wrote:
>>> seems to be printing OOPSx and PSx all over the left part of the screen.
>>
>> That usually indicates a problem where the program tries to send some
>> terminal command string with the curses library but the string is not
>> known. Maybe you can try another terminal type setting. (vt100 instead
>> of xterm, etc).
>
>   Ok, here's a dumb question: What does vt100, xterm, etc mean?

It should mean that the terminal responds to the escape sequences listed
in the termcap/terminfo for the given name vt100, etc., as the terminal
type is documented (for vt100 that's a hardware specification, for xterm,
that's the program I maintain).

>   In Unix, it seems that terminal types are important for some reason.
> No matter what system, it seems to output terminal type when you log in.

That's probably because the system's not able to determine your terminal
type in another way.

>   When I run midnight commander in a full screen session on NetBSD, I
> get no blue colors, and all the function keys are shifted -1 (F10
> becomes F9, etc). When I run midnight commander from screen through an
> ssh login, I get a blue colored background, and the function keys work
> as expected. Same thing when I run midnight commander from a
> wterm-window i X.

midnight commander uses the termcap/terminfo, additional config files 
(which in some cases just tell it that a given $TERM means the same thing
as another - not much value if you know which $TERM it should be).

screen reads the termcap/terminfo, has additional config to add or 
override termcap/terminfo features.  It's possible to define an entry in 
the terminal database (such as screen.vt100) to modify its behavior, 
though most people don't use that (I do, finding that its assumptions 
don't work well ;-)

To make things more complicated, screen sets the $TERM and $TERMCAP to 
pretend that the terminal behaves like the termcap/terminfo for screen 
(which happens to state that the terminal supports color).  midnight 
commander might also do something like this (the bundled copy of the slang 
library did at one time have a lot of hardcoded behavior to set this and 
other features that were useful to people who were using rxvt and didn't 
have an easy way to change the system's termcap ;-)

>   I have tried to understand what all this means, but to no avail. I
> read that vt100 is some old standard from DEC serial terminals, blah,
> blah, blah.. vt220 is the same thing, but it supports more keys, blah,
> blah, blah..
>
>   But I haven't figured out what a terminal type *is*, and how they can
> explain the midnight commander behavior. (But I believe it could).
>
>   Could someone point me to a good resource that explains terminal
> types? What they are, what types there are, how they differ, and why
> there isn't a Universial Solution Which Everyone Uses.
>
>   This is one of those things that is about go give me a serious
> bleeding in my brain:
>
>   From /etc/wscons.conf:
> ------------------------------
> # screens to create
> #       idx     screen  emul
> # Screen 0 is already configured as console in most cases.
> #  Uncomment if a serial console is used.
> #screen 0       -       vt100
> screen  1       80x50   vt100
> screen  2       80x50   vt100
> screen  3       80x50   vt100
> screen  4       -       -
> #screen 4       80x25bf vt100
> ------------------------------
>
>   From /etc/ttys:
> ------------------------------
> #console        "/usr/libexec/getty Pc"         vt100   on secure
> console "/usr/libexec/getty Pc"         vt220   on secure
> ttyE0   "/usr/libexec/getty Pc"         vt220   off secure
> ttyE1   "/usr/libexec/getty Pc"         vt220   on secure
> ttyE2   "/usr/libexec/getty Pc"         vt220   on secure
> ttyE3   "/usr/libexec/getty Pc"         vt220   on secure
> ------------------------------
>
>   One file says vt100, and another vt220. Is this a problem? What do
> they mean?
>
> -- 
> Kind Regards,
> Jan Danielsson
> Te audire non possum. Musa sapientum fixa est in aure.
>
>

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net