diff --git a/pymux/format.py b/pymux/format.py index 3c6abda..d5ca6e3 100644 --- a/pymux/format.py +++ b/pymux/format.py @@ -81,14 +81,15 @@ def literal(): } # Date/time formatting. - try: - if six.PY2: - string = datetime.datetime.now().strftime( - string.encode('utf-8')).decode('utf-8') - else: - string = datetime.datetime.now().strftime(string) - except ValueError: # strftime format ends with raw % - string = '' + if '%' in string: + try: + if six.PY2: + string = datetime.datetime.now().strftime( + string.encode('utf-8')).decode('utf-8') + else: + string = datetime.datetime.now().strftime(string) + except ValueError: # strftime format ends with raw % + string = '' # Apply '#' formatting. for symbol, f in format_table.items(): diff --git a/pymux/key_mappings.py b/pymux/key_mappings.py index d4e7805..7f34454 100644 --- a/pymux/key_mappings.py +++ b/pymux/key_mappings.py @@ -57,6 +57,11 @@ def prompt_toolkit_key_to_vt100_key(key, application_mode=False): Keys.Down: '\x1bOB', } + if key == Keys.ControlJ: + # Required for redis-cli. This can be removed when prompt_toolkit stops + # replacing \r by \n. + return '\r' + if key == '\n': return '\r' @@ -102,6 +107,11 @@ def prompt_toolkit_key_to_vt100_key(key, application_mode=False): 'C-Down': (Keys.ControlDown, ), 'C-\\': (Keys.ControlBackslash, ), + 'S-Left': (Keys.ShiftLeft, ), + 'S-Right': (Keys.ShiftRight, ), + 'S-Up': (Keys.ShiftUp, ), + 'S-Down': (Keys.ShiftDown, ), + 'M-C-a': (Keys.Escape, Keys.ControlA, ), 'M-C-b': (Keys.Escape, Keys.ControlB, ), 'M-C-c': (Keys.Escape, Keys.ControlC, ), diff --git a/pymux/options.py b/pymux/options.py index 83cf1ff..b07bcdd 100644 --- a/pymux/options.py +++ b/pymux/options.py @@ -177,7 +177,7 @@ def set_value(self, pymux, cli, value): 'prefix': KeyPrefixOption(), 'remain-on-exit': OnOffOption('remain_on_exit'), 'status': OnOffOption('enable_status'), - 'pane-status': OnOffOption('enable_pane_status'), + 'pane-border-status': OnOffOption('enable_pane_status'), 'status-keys': KeysOption('status_keys_vi_mode'), 'mode-keys': KeysOption('mode_keys_vi_mode'), 'default-terminal': StringOption( diff --git a/pymux/process.py b/pymux/process.py index 57e2c45..b734ae5 100644 --- a/pymux/process.py +++ b/pymux/process.py @@ -19,7 +19,6 @@ import sys import time import traceback -import datetime __all__ = ( 'Process', @@ -297,7 +296,7 @@ def do_asap(): # that we will process max 1k/1s in case of saturation. # That should be enough to prevent the UI from feeling # unresponsive. - timestamp = datetime.datetime.now() + datetime.timedelta(seconds=1) + timestamp = time.time() + 1 self.eventloop.call_from_executor( do_asap, _max_postpone_until=timestamp)