aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mitmproxy/tools/console/consoleaddons.py10
-rw-r--r--mitmproxy/tools/console/defaultkeys.py8
2 files changed, 16 insertions, 2 deletions
diff --git a/mitmproxy/tools/console/consoleaddons.py b/mitmproxy/tools/console/consoleaddons.py
index 4a687ff5..2a18fbb3 100644
--- a/mitmproxy/tools/console/consoleaddons.py
+++ b/mitmproxy/tools/console/consoleaddons.py
@@ -86,7 +86,7 @@ class ConsoleAddon:
"""
self.master.window.switch()
- @command.command("console.options.reset.current")
+ @command.command("console.options.reset.focus")
def options_reset_current(self) -> None:
"""
Reset the current option in the options editor.
@@ -469,6 +469,14 @@ class ConsoleAddon:
except ValueError as v:
raise exceptions.CommandError(v)
+ @command.command("console.key.execute.focus")
+ def key_execute_focus(self) -> None:
+ """
+ Execute the currently focused key binding.
+ """
+ b = self._keyfocus()
+ self.console_command(b.command)
+
def running(self):
self.started = True
diff --git a/mitmproxy/tools/console/defaultkeys.py b/mitmproxy/tools/console/defaultkeys.py
index 7edf0fd8..426dd10a 100644
--- a/mitmproxy/tools/console/defaultkeys.py
+++ b/mitmproxy/tools/console/defaultkeys.py
@@ -128,7 +128,7 @@ def map(km):
km.add("L", "console.command options.load ", ["options"], "Load from file")
km.add("S", "console.command options.save ", ["options"], "Save to file")
km.add("D", "options.reset", ["options"], "Reset all options")
- km.add("d", "console.options.reset.current", ["options"], "Reset this option")
+ km.add("d", "console.options.reset.focus", ["options"], "Reset this option")
km.add("a", "console.grideditor.add", ["grideditor"], "Add a row after cursor")
km.add("A", "console.grideditor.insert", ["grideditor"], "Insert a row before cursor")
@@ -164,3 +164,9 @@ def map(km):
["keybindings"],
"Unbind the currently focused key binding"
)
+ km.add(
+ "x",
+ "console.key.execute.focus",
+ ["keybindings"],
+ "Execute the currently focused key binding"
+ )