Your precious input suggested me an idea and I decided to check with the old
xmodmap which kinda bindings I might have for those keys.I don't exactly
know if xmodmap output might be valid for CLI as well, but here's what I got
by running "xmodmap -"
Home ---> ^[OH
End ---> ^[OF

Now I tried to bind those results, but without success :( as the following
combinations work inside xterm, but *not* in CLI (kinda puzzling indeed, as
the same "xmodmap -" shows your same escape sequence for Del ^[[3~ which
also works in CLI):

bind '^[OH'=beginning-of-line
bind '^[OF'=end-of-line

SO... I explored your way (Ctrl-V) and got these results on CLI:

Ctrl-V+Home ---> ^[[7~
Ctrl-V+End  ---> ^[[8~

The immediate try with "bind '^[[7~'=beginning-of-line" led to an
effectively working Home, adding a tilde every keypress.
So I decided to copy your way for Del and to define "^[[7" as a prefix with
"bind '^[[7'=prefix-1" as prefix-2 was already busy with Del; and then again
"bind '^[[7~'=beginning-of-line"; you know what??? IT WORKED!

Now the problem becomes End, as I also discovered that there's no such thing
as prefix-0, prefix-3, etc... just prefix-1 (now busy for Home) and prefix-2
(already booked for Del). So, in this long story these are the results:

Del: always working in CLI and xterm (using ^[[3~ and prefix-2 technique)
Home: working in CLI with ^[[7~ using prefix-1, but not working in xterm;
working in xterm with ^[OH but not working in CLI
End: not working with ^[[8~ because there are no more prefix-? to use;
working in xterm with ^[OF but not working in CLI

Now I'm getting REALLY puzzled....
...any  more clues???

THX


>
>
>
> On Thu, Nov 11, 2010 at 4:10 AM, Ted Unangst <ted.unan...@gmail.com>wrote:
>
>> On Wed, Nov 10, 2010 at 7:29 PM, Paolo Aglialoro <paol...@gmail.com>
>> wrote:
>> > thanks, first of all. Del key is now working marvellously :)
>> > (btw, is this hack valid cross platform?)
>> >
>> > Instead Home and End are still stuck... buy, maybe, this could be due to
>> the
>> > fact that where I'm experimenting is a laptop (dell latitude L400) and
>> I'm
>> > getting respectively Home with Fn+PgUp and End with Fn+PgDn.
>>
>> Those happen to be the bindings that worked on my system.
>>
>> The best way to fix your system is to bind to whatever keycodes the
>> buttons make.  This is probably accomplished by typing bind 'ctrl-V
>> home'=beginning-of-line.
>>
>> ctrl-v escapes the next button you press.

Reply via email to