aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/tools/console/commands.py
diff options
context:
space:
mode:
Diffstat (limited to 'mitmproxy/tools/console/commands.py')
-rw-r--r--mitmproxy/tools/console/commands.py27
1 files changed, 5 insertions, 22 deletions
diff --git a/mitmproxy/tools/console/commands.py b/mitmproxy/tools/console/commands.py
index 76827a99..e4535314 100644
--- a/mitmproxy/tools/console/commands.py
+++ b/mitmproxy/tools/console/commands.py
@@ -1,30 +1,12 @@
import urwid
import blinker
import textwrap
-from mitmproxy.tools.console import common
+from mitmproxy.tools.console import layoutwidget
from mitmproxy.tools.console import signals
HELP_HEIGHT = 5
-footer = [
- ('heading_key', "enter"), ":edit ",
- ('heading_key', "?"), ":help ",
-]
-
-
-def _mkhelp():
- text = []
- keys = [
- ("enter", "execute command"),
- ]
- text.extend(common.format_keyvals(keys, key="key", val="text", indent=4))
- return text
-
-
-help_context = _mkhelp()
-
-
def fcol(s, width, attr):
s = str(s)
return (
@@ -117,7 +99,7 @@ class CommandsList(urwid.ListBox):
super().__init__(self.walker)
def keypress(self, size, key):
- if key == "enter":
+ if key == "m_select":
foc, idx = self.get_focus()
signals.status_prompt_command.send(partial=foc.cmd.path + " ")
elif key == "m_start":
@@ -151,7 +133,8 @@ class CommandHelp(urwid.Frame):
self.set_body(self.widget(txt))
-class Commands(urwid.Pile):
+class Commands(urwid.Pile, layoutwidget.LayoutWidget):
+ title = "Commands"
keyctx = "commands"
def __init__(self, master):
@@ -165,7 +148,7 @@ class Commands(urwid.Pile):
self.master = master
def keypress(self, size, key):
- if key == "tab":
+ if key == "m_next":
self.focus_position = (
self.focus_position + 1
) % len(self.widget_list)