Fix broken CTRL+arrow key shortcuts under some terms

This commit is contained in:
Célestin Matte 2014-12-29 23:57:56 +01:00 committed by mathieui
parent cf04e65983
commit 8e575de52c
No known key found for this signature in database
GPG key ID: C59F84CEEFD616E3
2 changed files with 5 additions and 0 deletions

View file

@ -66,6 +66,9 @@ def get_char_list(s):
if key == '^[':
try:
part = s.get_wch()
if part == '[':
# CTRL+arrow and meta+arrow keys have a long format
part += s.get_wch() + s.get_wch() + s.get_wch() + s.get_wch()
except curses.error:
pass
except ValueError: # invalid input

View file

@ -43,6 +43,8 @@ class Input(Win):
'^D': self.key_dc,
'M-b': self.jump_word_left,
"M-[1;5D": self.jump_word_left,
"kRIT5": self.jump_word_right,
"kLFT5": self.jump_word_left,
'^W': self.delete_word,
'M-d': self.delete_next_word,
'^K': self.delete_end_of_line,