summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2015-10-29 17:04:38 (EDT)
committer P. J. McDermott <pj@pehjota.net>2015-10-29 17:04:38 (EDT)
commit8c6d6d848c7e38842f7f6a65d255afca08f60a72 (patch)
tree6bd34ef5a3fb9bae540e734d8b5a7042f96ce098 /src
parent93f3649d5a5e2239dca8dc83418672b6c53e4abc (diff)
downloadfirman.sh-8c6d6d848c7e38842f7f6a65d255afca08f60a72.zip
firman.sh-8c6d6d848c7e38842f7f6a65d255afca08f60a72.tar.gz
firman.sh-8c6d6d848c7e38842f7f6a65d255afca08f60a72.tar.bz2
_term_get_escseq(): Handle KEY_HOME and KEY_END on Linux console
Diffstat (limited to 'src')
-rw-r--r--src/term.sh20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/term.sh b/src/term.sh
index b96d555..b3108ae 100644
--- a/src/term.sh
+++ b/src/term.sh
@@ -283,21 +283,33 @@ _term_get_escseq()
'B') key=KEY_DOWN;;
'C') key=KEY_RIGHT;;
'D') key=KEY_LEFT;;
- 'H') key=KEY_HOME;;
- 'F') key=KEY_END;;
+ 'H') key=KEY_HOME;; # XTerm
+ 'F') key=KEY_END;; # XTerm
+ '1')
+ _term_get_byte
+ case "${term_byte}" in
+ '~') key=KEY_HOME;; # Linux
+ esac
+ ;;
'3')
_term_get_byte
case "${term_byte}" in
'~') key=KEY_DEL;;
esac
;;
+ '4')
+ _term_get_byte
+ case "${term_byte}" in
+ '~') key=KEY_END;; # Linux
+ esac
+ ;;
esac
;;
'O')
_term_get_byte
case "${term_byte}" in
- 'H') key=KEY_HOME;;
- 'F') key=KEY_END;;
+ 'H') key=KEY_HOME;; # VTE
+ 'F') key=KEY_END;; # VTE
esac
;;
esac