I know I can do:
bindkey "...." action
where …. is what i get by typing ctrl-v and then ctrl-f1. but it looks bad, contains bad characters (^[), and is generally not cool.
when binding to f1, i can do:
bindkey -k k1 action
but I can't seem to find termcap capability name for ctrl-functionkey.
Where can I find it?
When I press ctrl-v ctrl-f1 on terminal I get:
^[O5P
these are 4 bytes, not 5:
=$ echo "^[O5P" | hexdump -C
00000000 1b 4f 35 50 0a |.O5P.|
Best Answer
Unfortunately,
screen
apparently doesn't understand enough function keys to be able to process Ctrl-F1. At least I have not been able to getbindkey -k FF stuff "pressed Ctrl-F1"
to work even after trying to define FF or kf25 using thetermcap
orterminfo
commands in~/.screenrc
. I also tried "kf25" in thebindkey
command. In either case, I get a "bindkey: unknown key" message.Perhaps you or someone else will be able to get farther using the information here.
Otherwise, you can continue to use the ugly, uncool method. For onlookers, it's uncool to use hard-coded escape sequences instead of capability names because it won't be portable to other terminal types.
Capability names:
Output from
tput
: