diff options
author | Thomas Kriechbaumer <Kriechi@users.noreply.github.com> | 2020-04-11 14:10:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-11 14:10:43 +0200 |
commit | ce50e8e52dc5316f9be29bc00d0dc72fc2b0af83 (patch) | |
tree | 3fac96f6336876812507e1cf92447ae8d42d96c6 | |
parent | 0d9e517c064ca3992fac83c3a1ec6e4284221e72 (diff) | |
parent | b6954db601a159af01ac9d7bceace966abe2f89e (diff) | |
download | mitmproxy-ce50e8e52dc5316f9be29bc00d0dc72fc2b0af83.tar.gz mitmproxy-ce50e8e52dc5316f9be29bc00d0dc72fc2b0af83.tar.bz2 mitmproxy-ce50e8e52dc5316f9be29bc00d0dc72fc2b0af83.zip |
Merge pull request #3923 from sarthak212/commonkeybinding
Add common options to keybinding console
-rw-r--r-- | mitmproxy/tools/console/defaultkeys.py | 12 | ||||
-rw-r--r-- | mitmproxy/tools/console/flowview.py | 2 | ||||
-rw-r--r-- | mitmproxy/tools/console/help.py | 14 | ||||
-rw-r--r-- | mitmproxy/tools/console/keymap.py | 1 |
4 files changed, 21 insertions, 8 deletions
diff --git a/mitmproxy/tools/console/defaultkeys.py b/mitmproxy/tools/console/defaultkeys.py index a0f27625..a27fd85c 100644 --- a/mitmproxy/tools/console/defaultkeys.py +++ b/mitmproxy/tools/console/defaultkeys.py @@ -1,14 +1,14 @@ def map(km): - km.add(":", "console.command ", ["global"], "Command prompt") + km.add(":", "console.command ", ["commonkey", "global"], "Command prompt") km.add("?", "console.view.help", ["global"], "View help") km.add("B", "browser.start", ["global"], "Start an attached browser") km.add("C", "console.view.commands", ["global"], "View commands") km.add("K", "console.view.keybindings", ["global"], "View key bindings") - km.add("O", "console.view.options", ["global"], "View options") - km.add("E", "console.view.eventlog", ["global"], "View event log") + km.add("O", "console.view.options", ["commonkey", "global"], "View options") + km.add("E", "console.view.eventlog", ["commonkey", "global"], "View event log") km.add("Q", "console.exit", ["global"], "Exit immediately") - km.add("q", "console.view.pop", ["global"], "Exit the current view") + km.add("q", "console.view.pop", ["commonkey", "global"], "Exit the current view") km.add("-", "console.layout.cycle", ["global"], "Cycle to next layout") km.add("shift tab", "console.panes.next", ["global"], "Focus next layout pane") km.add("ctrl right", "console.panes.next", ["global"], "Focus next layout pane") @@ -20,8 +20,8 @@ def map(km): km.add("j", "console.nav.down", ["global"], "Down") km.add("l", "console.nav.right", ["global"], "Right") km.add("h", "console.nav.left", ["global"], "Left") - km.add("tab", "console.nav.next", ["global"], "Next") - km.add("enter", "console.nav.select", ["global"], "Select") + km.add("tab", "console.nav.next", ["commonkey", "global"], "Next") + km.add("enter", "console.nav.select", ["commonkey", "global"], "Select") km.add("space", "console.nav.pagedown", ["global"], "Page down") km.add("ctrl f", "console.nav.pagedown", ["global"], "Page down") km.add("ctrl b", "console.nav.pageup", ["global"], "Page up") diff --git a/mitmproxy/tools/console/flowview.py b/mitmproxy/tools/console/flowview.py index 2fa1df1f..fd41da0d 100644 --- a/mitmproxy/tools/console/flowview.py +++ b/mitmproxy/tools/console/flowview.py @@ -126,7 +126,7 @@ class FlowDetails(tabs.Tabs): self.master.log.debug(error) # Give hint that you have to tab for the response. if description == "No content" and isinstance(message, http.HTTPRequest): - description = "No request content (press tab to view response)" + description = "No request content" # If the users has a wide terminal, he gets fewer lines; this should not be an issue. chars_per_line = 80 diff --git a/mitmproxy/tools/console/help.py b/mitmproxy/tools/console/help.py index fb4e0051..5a7bbb9a 100644 --- a/mitmproxy/tools/console/help.py +++ b/mitmproxy/tools/console/help.py @@ -51,10 +51,22 @@ class HelpView(tabs.Tabs, layoutwidget.LayoutWidget): text = [ urwid.Text( [ - ("title", "Keybindings for this view") + ("title", "Common Keybindings") ] ) + ] + + text.extend(self.format_keys(self.master.keymap.list("commonkey"))) + + text.append( + urwid.Text( + [ + "\n", + ("title", "Keybindings for this view") + ] + ) + ) if self.helpctx: text.extend(self.format_keys(self.master.keymap.list(self.helpctx))) diff --git a/mitmproxy/tools/console/keymap.py b/mitmproxy/tools/console/keymap.py index a42225cf..0a1c64ef 100644 --- a/mitmproxy/tools/console/keymap.py +++ b/mitmproxy/tools/console/keymap.py @@ -18,6 +18,7 @@ class KeyBindingError(Exception): Contexts = { "chooser", "commands", + "commonkey", "dataviewer", "eventlog", "flowlist", |