Escape sequences responsible for cursor movement, and escape sequences associated with arrow keys, are generally distinct and should not be used instead of each other. In the terminfo
database, the former are prefixed with cursor
and the latter with key
.
Thus, to move the cursor to the left, one should use putp (cursor_left)
, not putp (key_left)
.