From what I can tell reading terminfo(5)
, kcuu1 should be the sequence that the terminal sends when the up arrow is pressed. I have never, ever seen that be any
Arrow and other special keys (terminfo refers to them as "keypad") send different codes depending on whether the terminal is in "application mode" or not. An application that wants to make use of the various k*
keys is supposed to output smkx
first (and rmkx
at the end to restore the old behavior).
You can try Ctrl+V Up in vi (or a similar terminal application) to see that Up does indeed send \EOA
there.
See these links for more details: