help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug in xterm -nw mode?


From: Thomas Dickey
Subject: Re: bug in xterm -nw mode?
Date: 18 Jul 2003 17:13:47 GMT
User-agent: tin/1.4.4-20000803 ("Vet for the Insane") (UNIX) (SunOS/5.8 (sun4u))

Sam Halliday <devnull@example.com> wrote:
> Thomas Dickey wrote:
>> Sam Halliday wrote:
>> The XFree86 xterm supports ANSI color and VT220 emulation

> thanks... there is no problem with xterm however, it is only with aterm.

> maybe i should report a bug to the aterm maintainers instead of with emacs?
> `emacs -nw` breaks with aterm and any TERM i have tried. xterm only breaks if 
> i
> choose TERM=rxvt, but that would be silly of course. you are the ncurses
> maintainer aren't you :-D? what do you think... is this default and expected
> behaviour in `emacs -nw` with aterm, TERM=rxvt?

it depends - reading your original posting, I see a couple of things to
keep in mind:

        a) the codes used for home/end on the keyboard may be changed at
           compile-time.

        b) the terminfo strings to which they may be assigned is a matter
           of what the user wants to be compatible with.

For the first case, I see this in aterm's command.c:
/* 
 * key-strings: if only these keys were standardized <sigh> 
 */
#ifdef LINUX_KEYS
# define KS_HOME        "\033[1~"       /* Home == Find */
# define KS_END         "\033[4~"       /* End == Select */
#else
# define KS_HOME        "\033[7~"       /* Home */
# define KS_END         "\033[8~"       /* End */
#endif

The terminfo is written to assume the latter (not Linux-keys).  But the name
given is misleading, since the \E[1~ and \E[4~ are taken from vt220, which has
a 6-key editing keypad, with insert/delete/next/previous - and find/select - no
home/end.  So someone setting up bindings for a vt220-style keyboard would be
inclined to use the corresponding mnemonics in the terminfo.

Why not both?  (define the terminfo for home/end and find/select).  terminfo
(like termcap) can do this, but the main user of terminfo appears to be curses,
e.g., wgetch() which would only return the first entry found in the table.  So
the information wouldn't be used, much - except by applications that are making
key-bindings by name.  Since only one of the names for the home/find key(s)
would be in the termcap, it's possible that emacs would silently decide to not
do the binding, and simply give you the corresponding characters.

Just to complicate things, XFree86 xterm's home/end may send (configurable at
runtime) the vt220-style codes, or \E[OH and \E[OF, respectively.  The
xterm-color terminfo that I see installed on my Debian 3.0r1 uses the
vt220-style codes as well.

-- 
Thomas E. Dickey <dickey@radix.net> <dickey@herndon4.his.com>
http://dickey.his.com
ftp://dickey.his.com


reply via email to

[Prev in Thread] Current Thread [Next in Thread]