Change default binding to leave passthrough mode to Ctrl-V

Also, display the binding in the statusbar
This commit is contained in:
Florian Bruhin 2017-07-02 12:39:45 +02:00
parent df1685905e
commit a2f62238f1
2 changed files with 12 additions and 2 deletions

View File

@ -1979,7 +1979,7 @@ bindings.default:
<Ctrl-B>: hint all tab-bg
<Escape>: leave-mode
passthrough:
<Escape>: leave-mode
<Ctrl-V>: leave-mode
command:
# FIXME:conf what to do about up/down?
<Ctrl-P>: command-history-prev

View File

@ -263,7 +263,17 @@ class StatusBar(QWidget):
def _set_mode_text(self, mode):
"""Set the mode text."""
text = "-- {} MODE --".format(mode.upper())
if mode == 'passthrough':
key_instance = config.key_instance
all_bindings = key_instance.get_reverse_bindings_for('passthrough')
bindings = all_bindings.get('leave-mode')
if bindings:
suffix = ' ({} to leave)'.format(bindings[0])
else:
suffix = ''
else:
suffix = ''
text = "-- {} MODE --{}".format(mode.upper(), suffix)
self.txt.set_text(self.txt.Text.normal, text)
def _show_cmd_widget(self):