Subject: Re: kern/27256: terminal issues? (insert, home, end, page up, page down, and delete)
To: None <sirjesseb@hotmail.com>
From: Greg A. Woods <woods@weird.com>
List: netbsd-bugs
Date: 10/16/2004 12:44:22
[ On Thursday, October 14, 2004 at 01:01:11 (+0000), sirjesseb@hotmail.com wrote: ]
> Subject: kern/27256: terminal issues? (insert, home, end, page up, page down, and delete)
>
> (with TERM=vt100) Seems that the delete key backspaces instead of
> deleting the character in front of the curser... The rest of the keys
> in that area (insert, home, end, page up and page down) don't seem to
> work as they should either. In vt220 I believe page up and page down
> work correctly...
The question is though: what kind of terminal are you actually using?
Or are you using the console virtual terminals?
If the latter then the correct TERM setting (for i386) is "wsvt25m".
Or perhaps you are using an "xterm" virtual terminal?
If so then the correct TERM setting is "xterm".
You can't pick TERM definitions out of a hat or from thin air -- they
_must_ specify a terminal definition that matches the actual terminal
you are using as closely as possible. This is most critical for telling
things like libcurses what character sequences to send to control things
like cursor positioning, however it's also important for many
applications to know what sequences special keys on the terminal will
send when they are pressed.
As for the backspace/delete issue, well that's probably more related to
whatever your stty(1) "erase" value is set to, though the definition set
by TERM can also specify to the application what the "delete character"
key will send (the "kD" value)
Note that the "Delete" key on most of the DEC VT220 and newer and
compatible terminals sends the sequence: <ESC> [ 3 ~
(which is called the "remove escape sequence")
The official NetBSD "standard" default for the wscons(4) console
terminal emulator is for the "Backspace" key to generate a DEL character
(instead of the CTRL-H one many of us normally associate with
"backspace"). Most full-screen applications (emacs aside) will honour
the user definition of stty erase.
In X11 with the standard Xfree 4.x server (e.g. on NetBSD/i386) the key
at the top right corner of the main QWERTY block is normally given the
X11 keycode definition of of "Delete", and so in xterm this key sends
the <ESC> [ 3 ~ sequence to the application (unless the "deleteIsDEL"
resource is set to true, in which case it just sends DEL).
Strictly speaking I believe the current wsvt25 terminal type definition
is wrong w.r.t. the value it uses for "kD" (which it inherits from
vt220. It should probably, IIUC, override it to be \177.
--
Greg A. Woods
+1 416 218-0098 VE3TCP RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com> Secrets of the Weird <woods@weird.com>