Re: keyboard commands in xterm vs. leopard terminal
Re: keyboard commands in xterm vs. leopard terminal
- Subject: Re: keyboard commands in xterm vs. leopard terminal
- From: Harald Hanche-Olsen <email@hidden>
- Date: Mon, 21 Apr 2008 20:04:56 +0200 (CEST)
+ "Patrick J. Collins" <email@hidden>:
> I just was trying to use apple's terminal program and realized that
> home/end do not function as they do in xterm...
No, they scroll the terminal window up and down in Terminal.
> Actually what is weird is that shift-home/end do what x11 does with
> home/end in bash, but inside vi shift-home/end does nothing! So, that
> is really weird...
Not necessarily so weird.
Here is a nice experiment to run in an xterm:
Run the command: tput smkx; od -t ax1
Then hit home, end, return, control-d.
Next run the command: tput rmkx; od -t ax1
Then hit home, end, return, control-d.
You will learn that in the first case, home and end produce esc O H
and esc O F respectively, while in the second case, they produce
instead esc [ H and esc [ F.
Now the terminfo entry for xterm (and xterm-color) recognizes the
former keys as home and end, but not the second.
The "normal" mode for the keyboard is the one selected by running tput
rmkx; the "application" mode for the keyboard is the one selected by
running tput smkx. And guess what? Vi will do the equivalent of smkx
on startup and rmkx when done.
Now repeat your experiment in Terminal: You will see no difference
between smkx and rmkx mode. (You will of course have to type
shift-home and shift-end; they both work like unshifted home and end
do in xterm, in normal mode only.)
Confused yet? Read the relevant man pages terminfo, infocmp, tput.
If still not sufficiently confused, read
http://invisible-island.net/xterm/ctlseqs/ctlseqs.html
and weep.
- Harald
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden