diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/term.sh | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/src/term.sh b/src/term.sh index daf2647..f791a7f 100644 --- a/src/term.sh +++ b/src/term.sh @@ -276,14 +276,26 @@ _term_get_escseq() _term_get_byte case "${term_byte}" in - 'A') key=KEY_UP;; - 'B') key=KEY_DOWN;; - 'C') key=KEY_RIGHT;; - 'D') key=KEY_LEFT;; - '3') + '[') _term_get_byte case "${term_byte}" in - '~') key=KEY_DEL;; + 'A') key=KEY_UP;; + 'B') key=KEY_DOWN;; + 'C') key=KEY_RIGHT;; + 'D') key=KEY_LEFT;; + '3') + _term_get_byte + case "${term_byte}" in + '~') key=KEY_DEL;; + esac + ;; + esac + ;; + 'O') + _term_get_byte + case "${term_byte}" in + 'H') key=KEY_HOME;; + 'F') key=KEY_END;; esac ;; esac @@ -299,12 +311,7 @@ term_getch() _term_get_byte case "${term_byte}" in "$(printf '\033')") - _term_get_byte - case "${term_byte}" in - '[') - key="$(_term_get_escseq)" - ;; - esac + key="$(_term_get_escseq)" ;; ' ') key=KEY_SPACE;; "${HT}") key=KEY_TAB;; |