From 558e0a41c25ed927a3bd3244e82e50f2c1ec9f1c Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Fri, 20 Mar 2015 11:00:24 +1300 Subject: [PATCH] Fix general prompt input. --- libmproxy/console/__init__.py | 3 +++ libmproxy/console/common.py | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/libmproxy/console/__init__.py b/libmproxy/console/__init__.py index 013c80034..5ff8e8d7b 100644 --- a/libmproxy/console/__init__.py +++ b/libmproxy/console/__init__.py @@ -555,6 +555,9 @@ class ConsoleMaster(flow.FlowMaster): self.prompt_execute(k) elif k == "enter": self.prompt_execute() + else: + if common.is_keypress(k): + self.view.keypress(self.loop.screen_size, k) else: k = self.view.keypress(self.loop.screen_size, k) if k: diff --git a/libmproxy/console/common.py b/libmproxy/console/common.py index 3a708c7c9..90204d79f 100644 --- a/libmproxy/console/common.py +++ b/libmproxy/console/common.py @@ -31,6 +31,14 @@ METHOD_OPTIONS = [ ] +def is_keypress(k): + """ + Is this input event a keypress? + """ + if isinstance(k, basestring): + return True + + def highlight_key(s, k): l = [] parts = s.split(k, 1)