[illumos-Developer] Terminfo handling of pg/home/etc keys

Guido Berhoerster guido+illumos.org at berhoerster.name
Tue Oct 19 15:49:33 PDT 2010


* Joerg Schilling <Joerg.Schilling at fokus.fraunhofer.de> [2010-10-19 23:23]:
> Miika Vesti <miika+illumos at vesti.fi> wrote:
> 
> > 19.10.2010 20:54, Guido Berhoerster kirjoitti:
> > > * Joerg Schilling <Joerg.Schilling at fokus.fraunhofer.de> [2010-10-19 18:48]:
> > >> Anil Gulecha <anil.verve at gmail.com> wrote:
> > >>
> > >>> Hi All,
> > >>>
> > >>> I'd like to take up integrating
> > >>> https://defect.opensolaris.org/bz/show_bug.cgi?id=5574
> > >>>
> > >>> With the patch
> > >>> https://defect.opensolaris.org/bz/attachment.cgi?id=1258&action=edit
> > >>
> > >> What keys do you understand by khome and kend?
> > >>
> > >> If you are talking about the keys labelled "pos1" and "end" above the cursor 
> > >> keys from a PC keyboard, they create \EOH and \EOF if I call gnome terminal
> > >> or xterm on my machine.
> > > 
> > > You'll only find "Pos1" on German keyboards, it's "Home" on my
> > > 101 US PC keykboard.
> > > They also generate \E[H and \E[F in my xterm, verified via
> > > ksh93 -c 'set -o gmacs;function sc { printf "|%q|\n" "${.sh.edchar}";.sh.edchar=;};trap sc KEYBD;read -r c'
> > > 
> >
> > On my keyboard, output of this command after pressing Home and End keys
> > is \EOF and \EOH
> 
> I cannot speak for ksh93 and I don't know what this program does.....
> 
> It seems however that ksh93 uses the terminal emulator in a different mode than 
> vi. Which mode the tty operates in depends on the init string that is part of 
> the temcap or terminfo descriptor. The tests however show that the keys 
> labelled "Home" and "End" by xev produce \EOH and \EOF in vi.

That entirely depends wheter is uses the application cursor mode
or not, in xterm you control it with the appcursorDefault X
resource, you can also switch modes in the VT Options menu (by
default opened through ctrl+middle click) where it is called
"Enable Application Cursor Keys". Depending on whether it is
enabled or not xterm either produces ANSI or application cursor
mode escape sequences for all cursor keys. That is documented
behavior of xterm, please see my earlier mail for a link to the
corresponding xterm control sequences documentation.

-- 
Guido Berhoerster



More information about the Developer mailing list