http://invisible-island.net/xterm/xterm.faq.html
Copyright © 2014,2016 by Thomas E. Dickey
In 2014, I noticed a comment, which relates to the PF1-PF4 assignment, but also to the use of function-key modifiers:
... four of the function keys that had been working fine in rxvt did not work in XTerm.
and referencing
a table from 2005 on another site. Some of the discussion in
the latter page was (is still) incorrect.
Here is a better table generated from the ncurses database,
illustrating a few points:
^[[20;2~
. I started doing that in xterm
with patch #94, in
1999.SS3
(the \EO
string):
modifyCursorKeys
in patch #167 andmodifyFunctionKeys
in patch #216SS3
for modified function keys), like Konsole.A few quirks deserve comment:
kf0
capability. There is
no standard about whether this is F0 or F10; the developers
chose both.This table gives a better example than that presented in Phillip Gold's page:
\E
rather than
the ambiguous ^[
.kf63
, the last standard terminfo
function key.keysymdef.h
file.This table was generated from ncurses' terminal database by
list_keys -tx \ vt100 vt220 scoansi \ xterm-r5 xterm-r6 xterm-vt220 xterm-xf86-v44 xterm-new \ rxvt mgt screen
before tidying up the layout. The table is divided into four parts, listed alphabetically (except for function-keys):
NAME | vt100 | vt220 | scoansi | xterm- r5 |
xterm- r6 |
xterm- vt220 |
xterm- xf86-v44 |
xterm- new |
rxvt | mgt | screen |
---|---|---|---|---|---|---|---|---|---|---|---|
kcub1 | \EOD | \E[D | \E[D | \EOD | \EOD | \EOD | \EOD | \EOD | \E[D | \EOD | \EOD |
kcud1 | \EOB | \E[B | \E[B | \EOB | \EOB | \EOB | \EOB | \EOB | \E[B | \EOB | \EOB |
kcuf1 | \EOC | \E[C | \E[C | \EOC | \EOC | \EOC | \EOC | \EOC | \E[C | \EOC | \EOC |
kcuu1 | \EOA | \E[A | \E[A | \EOA | \EOA | \EOA | \EOA | \EOA | \E[A | \EOA | \EOA |
kf0 | \EOy | \EOq | \E[21~ | ||||||||
kf1 | \EOP | \EOP | \E[M | \E[11~ | \E[11~ | \EOP | \EOP | \EOP | \E[11~ | \EOP | \EOP |
kf2 | \EOQ | \EOQ | \E[N | \E[12~ | \E[12~ | \EOQ | \EOQ | \EOQ | \E[12~ | \EOQ | \EOQ |
kf3 | \EOR | \EOR | \E[O | \E[13~ | \E[13~ | \EOR | \EOR | \EOR | \E[13~ | \EOR | \EOR |
kf4 | \EOS | \EOS | \E[P | \E[14~ | \E[14~ | \EOS | \EOS | \EOS | \E[14~ | \EOS | \EOS |
kf5 | \EOt | \E[Q | \E[15~ | \E[15~ | \E[15~ | \E[15~ | \E[15~ | \E[15~ | \E[15~ | \E[15~ | |
kf6 | \EOu | \E[17~ | \E[R | \E[17~ | \E[17~ | \E[17~ | \E[17~ | \E[17~ | \E[17~ | \E[17~ | \E[17~ |
kf7 | \EOv | \E[18~ | \E[S | \E[18~ | \E[18~ | \E[18~ | \E[18~ | \E[18~ | \E[18~ | \E[18~ | \E[18~ |
kf8 | \EOl | \E[19~ | \E[T | \E[19~ | \E[19~ | \E[19~ | \E[19~ | \E[19~ | \E[19~ | \E[19~ | \E[19~ |
kf9 | \EOw | \E[20~ | \E[U | \E[20~ | \E[20~ | \E[20~ | \E[20~ | \E[20~ | \E[20~ | \E[20~ | \E[20~ |
kf10 | \EOx | \E[21~ | \E[V | \E[21~ | \E[21~ | \E[21~ | \E[21~ | \E[21~ | \E[21~ | \E[21~ | \E[21~ |
kf11 | \E[23~ | \E[W | \E[23~ | \E[23~ | \E[23~ | \E[23~ | \E[23~ | \E[23~ | \E[23~ | \E[23~ | |
kf12 | \E[24~ | \E[X | \E[24~ | \E[24~ | \E[24~ | \E[24~ | \E[24~ | \E[24~ | \E[24~ | \E[24~ | |
kf13 | \E[25~ | \E[Y | \E[25~ | \E[25~ | \EO2P | \E[1;2P | \E[25~ | \E[25~ | |||
kf14 | \E[26~ | \E[26~ | \E[26~ | \EO2Q | \E[1;2Q | \E[26~ | \E[26~ | ||||
kf15 | \E[a | \E[28~ | \E[28~ | \EO2R | \E[1;2R | \E[28~ | \E[28~ | ||||
kf16 | \E[b | \E[29~ | \E[29~ | \EO2S | \E[1;2S | \E[29~ | \E[29~ | ||||
kf17 | \E[31~ | \E[c | \E[31~ | \E[31~ | \E[15;2~ | \E[15;2~ | \E[31~ | \E[31~ | |||
kf18 | \E[32~ | \E[d | \E[32~ | \E[32~ | \E[17;2~ | \E[17;2~ | \E[32~ | \E[32~ | |||
kf19 | \E[33~ | \E[e | \E[33~ | \E[33~ | \E[18;2~ | \E[18;2~ | \E[33~ | \E[33~ | |||
kf20 | \E[34~ | \E[f | \E[34~ | \E[34~ | \E[19;2~ | \E[19;2~ | \E[34~ | \E[34~ | |||
kf21 | \E[g | \E[20;2~ | \E[20;2~ | \E[23$ | |||||||
kf22 | \E[h | \E[21;2~ | \E[21;2~ | \E[24$ | |||||||
kf23 | \E[i | \E[23;2~ | \E[23;2~ | \E[11\^ | |||||||
kf24 | \E[j | \E[24;2~ | \E[24;2~ | \E[12\^ | |||||||
kf25 | \E[k | \EO5P | \E[1;5P | \E[13\^ | |||||||
kf26 | \E[l | \EO5Q | \E[1;5Q | \E[14\^ | |||||||
kf27 | \E[m | \EO5R | \E[1;5R | \E[15\^ | |||||||
kf28 | \E[n | \EO5S | \E[1;5S | \E[17\^ | |||||||
kf29 | \E[o | \E[15;5~ | \E[15;5~ | \E[18\^ | |||||||
kf30 | \E[p | \E[17;5~ | \E[17;5~ | \E[19\^ | |||||||
kf31 | \E[q | \E[18;5~ | \E[18;5~ | \E[20\^ | |||||||
kf32 | \E[r | \E[19;5~ | \E[19;5~ | \E[21\^ | |||||||
kf33 | \E[s | \E[20;5~ | \E[20;5~ | \E[23\^ | |||||||
kf34 | \E[t | \E[21;5~ | \E[21;5~ | \E[24\^ | |||||||
kf35 | \E[u | \E[23;5~ | \E[23;5~ | \E[25\^ | |||||||
kf36 | \E[v | \E[24;5~ | \E[24;5~ | \E[26\^ | |||||||
kf37 | \E[w | \EO6P | \E[1;6P | \E[28\^ | |||||||
kf38 | \E[x | \EO6Q | \E[1;6Q | \E[29\^ | |||||||
kf39 | \E[y | \EO6R | \E[1;6R | \E[31\^ | |||||||
kf40 | \E[z | \EO6S | \E[1;6S | \E[32\^ | |||||||
kf41 | \E[@ | \E[15;6~ | \E[15;6~ | \E[33\^ | |||||||
kf42 | \E[[ | \E[17;6~ | \E[17;6~ | \E[34\^ | |||||||
kf43 | \E[\\ | \E[18;6~ | \E[18;6~ | \E[23@ | |||||||
kf44 | \E[] | \E[19;6~ | \E[19;6~ | \E[24@ | |||||||
kf45 | \E[\^ | \E[20;6~ | \E[20;6~ | ||||||||
kf46 | \E[_ | \E[21;6~ | \E[21;6~ | ||||||||
kf47 | \E[` | \E[23;6~ | \E[23;6~ | ||||||||
kf48 | \E[{ | \E[24;6~ | \E[24;6~ | ||||||||
kf49 | \E[1;3P | ||||||||||
kf50 | \E[1;3Q | ||||||||||
kf51 | \E[1;3R | ||||||||||
kf52 | \E[1;3S | ||||||||||
kf53 | \E[15;3~ | ||||||||||
kf54 | \E[17;3~ | ||||||||||
kf55 | \E[18;3~ | ||||||||||
kf56 | \E[19;3~ | ||||||||||
kf57 | \E[20;3~ | ||||||||||
kf58 | \E[21;3~ | ||||||||||
kf59 | \E[23;3~ | ||||||||||
kf60 | \E[24;3~ | ||||||||||
kf61 | \E[1;4P | ||||||||||
kf62 | \E[1;4Q | ||||||||||
kf63 | \E[1;4R | ||||||||||
kDC | \E[3;2~ | \E[3;2~ | \E[3$ | ||||||||
kEND | \E[1;2F | \E[1;2F | \E[8$ | ||||||||
kHOM | \E[1;2H | \E[1;2H | \E[7$ | ||||||||
kIC | \E[2;2~ | \E[2;2~ | \E[2$ | ||||||||
kLFT | \E[1;2D | \E[1;2D | \E[d | ||||||||
kNXT | \E[6;2~ | \E[6;2~ | \E[6$ | ||||||||
kPRV | \E[5;2~ | \E[5;2~ | \E[5$ | ||||||||
kRIT | \E[1;2C | \E[1;2C | \E[c | ||||||||
ka1 | \EOq | \EOw | \EOw | \EOw | |||||||
ka3 | \EOs | \EOy | \EOy | \EOy | |||||||
kb2 | \EOr | \EOu | \EOE | \EOE | \EOu | \EOu | |||||
kbeg | \E[E | \EOE | |||||||||
kbs | \b | \b | \b | \b | \b | ^? | \b | ^? | \b | \b | \b |
kc1 | \EOp | \EOq | \EOq | \EOq | |||||||
kc3 | \EOn | \EOs | \EOs | \EOs | |||||||
kcbt | \E[Z | \E[Z | \E[Z | \E[Z | \E[Z | \E[Z | |||||
kdch1 | \E[3~ | ^? | \E[3~ | \E[3~ | \E[3~ | \E[3~ | \E[3~ | \E[3~ | \E[3~ | \E[3~ | |
kdl1 | \E[31~ | ||||||||||
kel | \E[8~ | \E[8\^ | |||||||||
kend | \E[F | \E[4~ | \E[4~ | \EOF | \EOF | \E[8~ | \EOF | \E[4~ | |||
kent | \EOM | \EOM | \EOM | \EOM | \EOM | \EOM | |||||
kfnd | \E[1~ | \E[1~ | \E[1~ | ||||||||
khlp | \E[28~ | ||||||||||
khome | \E[H | \E[1~ | \E[1~ | \EOH | \EOH | \E[7~ | \EOH | \E[1~ | |||
kich1 | \E[2~ | \E[L | \E[2~ | \E[2~ | \E[2~ | \E[2~ | \E[2~ | \E[2~ | \E[2~ | \E[2~ | |
kil1 | \E[30~ | ||||||||||
kind | \E[1;2B | \E[a | |||||||||
kmous | \E[M | \E[M | \E[M | \E[M | \E[M | \E[M | \E[M | \E[M | |||
knp | \E[6~ | \E[G | \E[6~ | \E[6~ | \E[6~ | \E[6~ | \E[6~ | \E[6~ | \E[6~ | \E[6~ | |
kpp | \E[5~ | \E[I | \E[5~ | \E[5~ | \E[5~ | \E[5~ | \E[5~ | \E[5~ | \E[5~ | \E[5~ | |
krdo | \E[29~ | ||||||||||
kri | \E[1;2A | \E[b | |||||||||
kslt | \E[4~ | \E[4~ | \E[4~ | ||||||||
kDC3 | \E[3;3~ | ||||||||||
kDC4 | \E[3;4~ | ||||||||||
kDC5 | \E[3;5~ | \E[3\^ | |||||||||
kDC6 | \E[3;6~ | \E[3@ | |||||||||
kDC7 | \E[3;7~ | ||||||||||
kDN | \E[1;2B | \E[b | |||||||||
kDN3 | \E[1;3B | ||||||||||
kDN4 | \E[1;4B | ||||||||||
kDN5 | \E[1;5B | \EOb | |||||||||
kDN6 | \E[1;6B | ||||||||||
kDN7 | \E[1;7B | ||||||||||
kEND3 | \E[1;3F | ||||||||||
kEND4 | \E[1;4F | ||||||||||
kEND5 | \E[1;5F | \E[8\^ | |||||||||
kEND6 | \E[1;6F | \E[8@ | |||||||||
kEND7 | \E[1;7F | ||||||||||
kHOM3 | \E[1;3H | ||||||||||
kHOM4 | \E[1;4H | ||||||||||
kHOM5 | \E[1;5H | \E[7\^ | |||||||||
kHOM6 | \E[1;6H | \E[7@ | |||||||||
kHOM7 | \E[1;7H | ||||||||||
kIC3 | \E[2;3~ | ||||||||||
kIC4 | \E[2;4~ | ||||||||||
kIC5 | \E[2;5~ | \E[2\^ | |||||||||
kIC6 | \E[2;6~ | \E[2@ | |||||||||
kIC7 | \E[2;7~ | ||||||||||
kLFT3 | \E[1;3D | ||||||||||
kLFT4 | \E[1;4D | ||||||||||
kLFT5 | \E[1;5D | \EOd | |||||||||
kLFT6 | \E[1;6D | ||||||||||
kLFT7 | \E[1;7D | ||||||||||
kNXT3 | \E[6;3~ | ||||||||||
kNXT4 | \E[6;4~ | ||||||||||
kNXT5 | \E[6;5~ | \E[6\^ | |||||||||
kNXT6 | \E[6;6~ | \E[6@ | |||||||||
kNXT7 | \E[6;7~ | ||||||||||
kPRV3 | \E[5;3~ | ||||||||||
kPRV4 | \E[5;4~ | ||||||||||
kPRV5 | \E[5;5~ | \E[5\^ | |||||||||
kPRV6 | \E[5;6~ | \E[5@ | |||||||||
kPRV7 | \E[5;7~ | ||||||||||
kRIT3 | \E[1;3C | ||||||||||
kRIT4 | \E[1;4C | ||||||||||
kRIT5 | \E[1;5C | \EOc | |||||||||
kRIT6 | \E[1;6C | ||||||||||
kRIT7 | \E[1;7C | ||||||||||
kUP | \E[1;2A | \E[a | |||||||||
kUP3 | \E[1;3A | ||||||||||
kUP4 | \E[1;4A | ||||||||||
kUP5 | \E[1;5A | \EOa | |||||||||
kUP6 | \E[1;6A | ||||||||||
kUP7 | \E[1;7A | ||||||||||
ka2 | \EOx | \EOx | \EOx | \EOx | |||||||
kb1 | \EOt | \EOt | \EOt | \EOt | |||||||
kb3 | \EOv | \EOv | \EOv | \EOv | |||||||
kc2 | \EOr | \EOr | \EOr | \EOr |