Google Groups

asigning a certain command to a certain keyboard key


Stephane CHAZELAS Nov 23, 2003 10:12 AM
Posted in group: comp.unix.shell
2003-11-23, 06:25(-08), John Green:
[...]
> Using bash 2.05b in an xterm under Mandrake Linux 8.2.
>
> As an experiment, I tried to make the F1 key
> execute a clear command.  The Ctrl-V trick
> showed that F1 generates ^[OP
>
> I tried lots of different bind commands, which were accepted without
> protest.  However, pressing F1 at the command prompt afterwards
> just gives this error.
>
> bash_execute_unix_command: cannot find keymap for command
[...]

bash key mapping handling is mostly bogus. You may have more
chance with:

bind -x $'"\201":clear'
bind '"\eOP":'$'"\201"'

Troubles begin as soon as there's one binding for a char
sequence, that gets even worse with "-x".

--
Stéphane                      ["Stephane.Chazelas" at "free.fr"]