"home" works, but "end" not - Xwindows
This is a discussion on "home" works, but "end" not - Xwindows ; Hi,
I wasted serveral hours while trying to configure my xterm to accept the
home and end keys, so that the cursor moves to the beginning or the end
of the current line. The problem is, home works perfectly, but ...
-
"home" works, but "end" not
Hi,
I wasted serveral hours while trying to configure my xterm to accept the
home and end keys, so that the cursor moves to the beginning or the end
of the current line. The problem is, home works perfectly, but end does
not at all.
I did the following:
cd ~
mkdir .terminfo
infocmp > test.tic
tic test.tic
#this created a directory x with one file in it called xterm
cd /usr/share/terminfo
mv x someoldx
ln -s ~/.terminfo/x x
now i added "khome=\E[F" to the test.tic so it looked like:
# Reconstructed via infocmp from file: /michael//.terminfo/x/xterm
xterm|xterm terminal emulator (X Window System),
am, km, mir, msgr, xenl,
cols#80, it#8, lines#24,
acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{ {||}},
bel=^G, bold=\E[1m, clear=\E[H\E[2J, cr=^M,
csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J,
el=\E[K, enacs=\E)0, ht=^I, hts=\EH, il=\E[%p1%dL, il1=\E[L,
ind=^J, is2=\E7\E[r\E[m\E[?7h\E[?1;3;4;6l\E[4l\E8\E>,
kbs=\E[F, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
kdch1=\E[3~, khome=\E[F, kf1=\E[11~, kf10=\E[21~,
kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~,
kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~,
kf19=\E[33~, kf2=\E[12~, kf20=\E[34~, kf3=\E[13~,
kf4=\E[14~, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~,
kf9=\E[20~, kfnd=\E[1~, kich1=\E[2~, kmous=\E[M, knp=\E[6~,
kpp=\E[5~, kslt=\E[4~, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O,
rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, rmkx=\E[?1l\E>,
rmso=\E[m, rmul=\E[m,
rs2=\E7\E[r\E8\E[m\E[?7h\E[?1;3;4;6l\E[4l\E>, sc=\E7,
sgr0=\E[m, smacs=^N, smcup=\E7\E[?47h, smir=\E[4h,
smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m, tbc=\E[3g,
u6=\E[%i%d;%dR,
\E[F is the escape sequence for the home key. After starting a new
xterm, everything worked well. When i pressed home, the curser went to
the beginning of the line. But when i try the same with kend (without
changing the escape sequence), theres just a beep, and the cursor wont
move. To make things clear, i just replace the khome with kend and
compile it with tic.
Is kend not the right term cap (i got it from "man terminfo")?
Some strange hint. If i press ctrl+e or ctrl+a, the cursor goes to the
end / beginning of the line. So I think my xterm has the capabilities to
move the cursor as i want. But where is ctrl+e and ctrl+a mapped to
these activities. I cant find the escape sequences (^E or ^A) in my
test.dic or the output of infocmp.
Please help me,
Michael
-
Re: "home" works, but "end" not
Michael Isik wrote in message news:<403D2EB8.80408@arcor.de>...
> Hi,
> I wasted serveral hours while trying to configure my xterm to accept the
> home and end keys, so that the cursor moves to the beginning or the end
> of the current line. The problem is, home works perfectly, but end does
> not at all.
>
> I did the following:
> cd ~
> mkdir .terminfo
> infocmp > test.tic
> tic test.tic
> #this created a directory x with one file in it called xterm
>
> cd /usr/share/terminfo
> mv x someoldx
> ln -s ~/.terminfo/x x
>
> now i added "khome=\E[F" to the test.tic so it looked like:
> # Reconstructed via infocmp from file: /michael//.terminfo/x/xterm
=\E[26~,
> ... (cut)
>
> \E[F is the escape sequence for the home key. After starting a new
> xterm, everything worked well. When i pressed home, the curser went to
> ... (cut)
> Is kend not the right term cap (i got it from "man terminfo")?
>
>
> Some strange hint. If i press ctrl+e or ctrl+a, the cursor goes to the
> end / beginning of the line. So I think my xterm has the capabilities to
> move the cursor as i want. But where is ctrl+e and ctrl+a mapped to
> these activities. I cant find the escape sequences (^E or ^A) in my
> test.dic or the output of infocmp.
>
> Please help me,
> Michael
There are several ways to manage the keyboard under X11.
With the terminfo database it is a way to define the key sequences.
It seems that you want to use the [Home] and [End] in a xterm
window, at the shell level (command interpreter).
You don't need to change the terminfo entry.
It up to the shell to adapt to the terminal.
It is the Korn shell (or Bash shell) that manage to map the [Ctrl][A]
[Ctrl][E] sequences : they are independent of the terminfo entry used.
You can map more or less easily the [End] key to act the same way as
[Ctrl][E]. (it depends on your version of the Korn shell).
You can also act at an other level, using the "translations" of xterm.
Look at :
http://groups.google.fr/groups?dq=&h...47ab253f06060c
http://groups.google.fr/groups?dq=&h...7bc24dd9960949
Hope this helps you.
ATNT
-
Re: "home" works, but "end" not
Michael Isik wrote:
> I wasted serveral hours while trying to configure my xterm to accept the
> home and end keys, so that the cursor moves to the beginning or the end
> of the current line. The problem is, home works perfectly, but end does
> not at all.
....
> now i added "khome=\E[F" to the test.tic so it looked like:
> # Reconstructed via infocmp from file: /michael//.terminfo/x/xterm
....
> Is kend not the right term cap (i got it from "man terminfo")?
Some applications look for kll rather than kend
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
-
Re: "home" works, but "end" not
> Some applications look for kll rather than kend
Thank you, that is exactly what i was searching for. Everything works now.