We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Toggling follow new option fails in single flow view.
#### Problem Description
Toggling follow new flow option via <kbd>F</kbd> does not work while in the view of a single flow.

#### Steps to reproduce the behavior:
1. launch mitmproxy
2. continually generate new requests
3. activate `Follow new` option
4. enter a flow
5. try to deactivate `Follow new` option
6. error: the view still follows the new flows

#### System Information
mitmproxy version 9.0.1


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `mitmproxy/tools/console/defaultkeys.py`
Content:
```
1 from mitmproxy.tools.console.keymap import Keymap
2 
3 
4 def map(km: Keymap) -> None:
5     km.add(":", "console.command ", ["commonkey", "global"], "Command prompt")
6     km.add(
7         ";",
8         "console.command flow.comment @focus ''",
9         ["flowlist", "flowview"],
10         "Add comment to flow",
11     )
12     km.add("?", "console.view.help", ["global"], "View help")
13     km.add("B", "browser.start", ["global"], "Start an attached browser")
14     km.add("C", "console.view.commands", ["global"], "View commands")
15     km.add("K", "console.view.keybindings", ["global"], "View key bindings")
16     km.add("O", "console.view.options", ["commonkey", "global"], "View options")
17     km.add("E", "console.view.eventlog", ["commonkey", "global"], "View event log")
18     km.add("Q", "console.exit", ["global"], "Exit immediately")
19     km.add("q", "console.view.pop", ["commonkey", "global"], "Exit the current view")
20     km.add("-", "console.layout.cycle", ["global"], "Cycle to next layout")
21     km.add("ctrl right", "console.panes.next", ["global"], "Focus next layout pane")
22     km.add("ctrl left", "console.panes.prev", ["global"], "Focus previous layout pane")
23     km.add("shift tab", "console.panes.next", ["global"], "Focus next layout pane")
24     km.add("P", "console.view.flow @focus", ["global"], "View flow details")
25 
26     km.add("?", "console.view.pop", ["help"], "Exit help")
27 
28     km.add("g", "console.nav.start", ["global"], "Go to start")
29     km.add("G", "console.nav.end", ["global"], "Go to end")
30     km.add("k", "console.nav.up", ["global"], "Up")
31     km.add("j", "console.nav.down", ["global"], "Down")
32     km.add("l", "console.nav.right", ["global"], "Right")
33     km.add("h", "console.nav.left", ["global"], "Left")
34     km.add("tab", "console.nav.next", ["commonkey", "global"], "Next")
35     km.add("enter", "console.nav.select", ["commonkey", "global"], "Select")
36     km.add("space", "console.nav.pagedown", ["global"], "Page down")
37     km.add("ctrl f", "console.nav.pagedown", ["global"], "Page down")
38     km.add("ctrl b", "console.nav.pageup", ["global"], "Page up")
39 
40     km.add(
41         "I",
42         "set intercept_active toggle",
43         ["global"],
44         "Toggle whether the filtering via the intercept option is enabled",
45     )
46     km.add("i", "console.command.set intercept", ["global"], "Set intercept")
47     km.add("W", "console.command.set save_stream_file", ["global"], "Stream to file")
48     km.add(
49         "A",
50         "flow.resume @all",
51         ["flowlist", "flowview"],
52         "Resume all intercepted flows",
53     )
54     km.add(
55         "a",
56         "flow.resume @focus",
57         ["flowlist", "flowview"],
58         "Resume this intercepted flow",
59     )
60     km.add(
61         "b",
62         "console.command cut.save @focus response.content ",
63         ["flowlist", "flowview"],
64         "Save response body to file",
65     )
66     km.add(
67         "d",
68         "view.flows.remove @focus",
69         ["flowlist", "flowview"],
70         "Delete flow from view",
71     )
72     km.add(
73         "D", "view.flows.duplicate @focus", ["flowlist", "flowview"], "Duplicate flow"
74     )
75     km.add(
76         "e",
77         """
78         console.choose.cmd Format export.formats
79         console.command export.file {choice} @focus
80         """,
81         ["flowlist", "flowview"],
82         "Export this flow to file",
83     )
84     km.add("f", "console.command.set view_filter", ["flowlist"], "Set view filter")
85     km.add("F", "set console_focus_follow toggle", ["flowlist"], "Set focus follow")
86     km.add(
87         "ctrl l",
88         "console.command cut.clip ",
89         ["flowlist", "flowview"],
90         "Send cuts to clipboard",
91     )
92     km.add(
93         "L", "console.command view.flows.load ", ["flowlist"], "Load flows from file"
94     )
95     km.add("m", "flow.mark.toggle @focus", ["flowlist"], "Toggle mark on this flow")
96     km.add(
97         "M",
98         "view.properties.marked.toggle",
99         ["flowlist"],
100         "Toggle viewing marked flows",
101     )
102     km.add(
103         "n",
104         "console.command view.flows.create get https://example.com/",
105         ["flowlist"],
106         "Create a new flow",
107     )
108     km.add(
109         "o",
110         """
111         console.choose.cmd Order view.order.options
112         set view_order {choice}
113         """,
114         ["flowlist"],
115         "Set flow list order",
116     )
117     km.add("r", "replay.client @focus", ["flowlist", "flowview"], "Replay this flow")
118     km.add("S", "console.command replay.server ", ["flowlist"], "Start server replay")
119     km.add(
120         "v", "set view_order_reversed toggle", ["flowlist"], "Reverse flow list order"
121     )
122     km.add("U", "flow.mark @all false", ["flowlist"], "Un-set all marks")
123     km.add(
124         "w",
125         "console.command save.file @shown ",
126         ["flowlist"],
127         "Save listed flows to file",
128     )
129     km.add(
130         "V",
131         "flow.revert @focus",
132         ["flowlist", "flowview"],
133         "Revert changes to this flow",
134     )
135     km.add("X", "flow.kill @focus", ["flowlist"], "Kill this flow")
136     km.add("z", "view.flows.remove @all", ["flowlist"], "Clear flow list")
137     km.add(
138         "Z", "view.flows.remove @hidden", ["flowlist"], "Purge all flows not showing"
139     )
140     km.add(
141         "|",
142         "console.command script.run @focus ",
143         ["flowlist", "flowview"],
144         "Run a script on this flow",
145     )
146 
147     km.add(
148         "e",
149         """
150         console.choose.cmd Part console.edit.focus.options
151         console.edit.focus {choice}
152         """,
153         ["flowview"],
154         "Edit a flow component",
155     )
156     km.add(
157         "f",
158         "view.settings.setval.toggle @focus fullcontents",
159         ["flowview"],
160         "Toggle viewing full contents on this flow",
161     )
162     km.add("w", "console.command save.file @focus ", ["flowview"], "Save flow to file")
163     km.add("space", "view.focus.next", ["flowview"], "Go to next flow")
164 
165     km.add(
166         "v",
167         """
168         console.choose "View Part" request,response
169         console.bodyview @focus {choice}
170         """,
171         ["flowview"],
172         "View flow body in an external viewer",
173     )
174     km.add("p", "view.focus.prev", ["flowview"], "Go to previous flow")
175     km.add(
176         "m",
177         """
178         console.choose.cmd Mode console.flowview.mode.options
179         console.flowview.mode.set {choice}
180         """,
181         ["flowview"],
182         "Set flow view mode",
183     )
184     km.add(
185         "z",
186         """
187         console.choose "Part" request,response
188         flow.encode.toggle @focus {choice}
189         """,
190         ["flowview"],
191         "Encode/decode flow body",
192     )
193 
194     km.add("L", "console.command options.load ", ["options"], "Load from file")
195     km.add("S", "console.command options.save ", ["options"], "Save to file")
196     km.add("D", "options.reset", ["options"], "Reset all options")
197     km.add("d", "console.options.reset.focus", ["options"], "Reset this option")
198 
199     km.add("a", "console.grideditor.add", ["grideditor"], "Add a row after cursor")
200     km.add(
201         "A", "console.grideditor.insert", ["grideditor"], "Insert a row before cursor"
202     )
203     km.add("d", "console.grideditor.delete", ["grideditor"], "Delete this row")
204     km.add(
205         "r",
206         "console.command console.grideditor.load",
207         ["grideditor"],
208         "Read unescaped data into the current cell from file",
209     )
210     km.add(
211         "R",
212         "console.command console.grideditor.load_escaped",
213         ["grideditor"],
214         "Load a Python-style escaped string into the current cell from file",
215     )
216     km.add("e", "console.grideditor.editor", ["grideditor"], "Edit in external editor")
217     km.add(
218         "w",
219         "console.command console.grideditor.save ",
220         ["grideditor"],
221         "Save data to file as CSV",
222     )
223 
224     km.add("z", "eventstore.clear", ["eventlog"], "Clear")
225 
226     km.add(
227         "a",
228         """
229         console.choose.cmd "Context" console.key.contexts
230         console.command console.key.bind {choice}
231         """,
232         ["keybindings"],
233         "Add a key binding",
234     )
235     km.add(
236         "d",
237         "console.key.unbind.focus",
238         ["keybindings"],
239         "Unbind the currently focused key binding",
240     )
241     km.add(
242         "x",
243         "console.key.execute.focus",
244         ["keybindings"],
245         "Execute the currently focused key binding",
246     )
247     km.add(
248         "enter",
249         "console.key.edit.focus",
250         ["keybindings"],
251         "Edit the currently focused key binding",
252     )
253
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/mitmproxy/tools/console/defaultkeys.py b/mitmproxy/tools/console/defaultkeys.py
--- a/mitmproxy/tools/console/defaultkeys.py
+++ b/mitmproxy/tools/console/defaultkeys.py
@@ -82,7 +82,12 @@
         "Export this flow to file",
     )
     km.add("f", "console.command.set view_filter", ["flowlist"], "Set view filter")
-    km.add("F", "set console_focus_follow toggle", ["flowlist"], "Set focus follow")
+    km.add(
+        "F",
+        "set console_focus_follow toggle",
+        ["flowlist", "flowview"],
+        "Set focus follow",
+    )
     km.add(
         "ctrl l",
         "console.command cut.clip ",

{"golden_diff": "diff --git a/mitmproxy/tools/console/defaultkeys.py b/mitmproxy/tools/console/defaultkeys.py\n--- a/mitmproxy/tools/console/defaultkeys.py\n+++ b/mitmproxy/tools/console/defaultkeys.py\n@@ -82,7 +82,12 @@\n         \"Export this flow to file\",\n     )\n     km.add(\"f\", \"console.command.set view_filter\", [\"flowlist\"], \"Set view filter\")\n-    km.add(\"F\", \"set console_focus_follow toggle\", [\"flowlist\"], \"Set focus follow\")\n+    km.add(\n+        \"F\",\n+        \"set console_focus_follow toggle\",\n+        [\"flowlist\", \"flowview\"],\n+        \"Set focus follow\",\n+    )\n     km.add(\n         \"ctrl l\",\n         \"console.command cut.clip \",\n", "issue": "Toggling follow new option fails in single flow view.\n#### Problem Description\r\nToggling follow new flow option via <kbd>F</kbd> does not work while in the view of a single flow.\r\n\r\n#### Steps to reproduce the behavior:\r\n1. launch mitmproxy\r\n2. continually generate new requests\r\n3. activate `Follow new` option\r\n4. enter a flow\r\n5. try to deactivate `Follow new` option\r\n6. error: the view still follows the new flows\r\n\r\n#### System Information\r\nmitmproxy version 9.0.1\r\n\n", "before_files": [{"content": "from mitmproxy.tools.console.keymap import Keymap\n\n\ndef map(km: Keymap) -> None:\n    km.add(\":\", \"console.command \", [\"commonkey\", \"global\"], \"Command prompt\")\n    km.add(\n        \";\",\n        \"console.command flow.comment @focus ''\",\n        [\"flowlist\", \"flowview\"],\n        \"Add comment to flow\",\n    )\n    km.add(\"?\", \"console.view.help\", [\"global\"], \"View help\")\n    km.add(\"B\", \"browser.start\", [\"global\"], \"Start an attached browser\")\n    km.add(\"C\", \"console.view.commands\", [\"global\"], \"View commands\")\n    km.add(\"K\", \"console.view.keybindings\", [\"global\"], \"View key bindings\")\n    km.add(\"O\", \"console.view.options\", [\"commonkey\", \"global\"], \"View options\")\n    km.add(\"E\", \"console.view.eventlog\", [\"commonkey\", \"global\"], \"View event log\")\n    km.add(\"Q\", \"console.exit\", [\"global\"], \"Exit immediately\")\n    km.add(\"q\", \"console.view.pop\", [\"commonkey\", \"global\"], \"Exit the current view\")\n    km.add(\"-\", \"console.layout.cycle\", [\"global\"], \"Cycle to next layout\")\n    km.add(\"ctrl right\", \"console.panes.next\", [\"global\"], \"Focus next layout pane\")\n    km.add(\"ctrl left\", \"console.panes.prev\", [\"global\"], \"Focus previous layout pane\")\n    km.add(\"shift tab\", \"console.panes.next\", [\"global\"], \"Focus next layout pane\")\n    km.add(\"P\", \"console.view.flow @focus\", [\"global\"], \"View flow details\")\n\n    km.add(\"?\", \"console.view.pop\", [\"help\"], \"Exit help\")\n\n    km.add(\"g\", \"console.nav.start\", [\"global\"], \"Go to start\")\n    km.add(\"G\", \"console.nav.end\", [\"global\"], \"Go to end\")\n    km.add(\"k\", \"console.nav.up\", [\"global\"], \"Up\")\n    km.add(\"j\", \"console.nav.down\", [\"global\"], \"Down\")\n    km.add(\"l\", \"console.nav.right\", [\"global\"], \"Right\")\n    km.add(\"h\", \"console.nav.left\", [\"global\"], \"Left\")\n    km.add(\"tab\", \"console.nav.next\", [\"commonkey\", \"global\"], \"Next\")\n    km.add(\"enter\", \"console.nav.select\", [\"commonkey\", \"global\"], \"Select\")\n    km.add(\"space\", \"console.nav.pagedown\", [\"global\"], \"Page down\")\n    km.add(\"ctrl f\", \"console.nav.pagedown\", [\"global\"], \"Page down\")\n    km.add(\"ctrl b\", \"console.nav.pageup\", [\"global\"], \"Page up\")\n\n    km.add(\n        \"I\",\n        \"set intercept_active toggle\",\n        [\"global\"],\n        \"Toggle whether the filtering via the intercept option is enabled\",\n    )\n    km.add(\"i\", \"console.command.set intercept\", [\"global\"], \"Set intercept\")\n    km.add(\"W\", \"console.command.set save_stream_file\", [\"global\"], \"Stream to file\")\n    km.add(\n        \"A\",\n        \"flow.resume @all\",\n        [\"flowlist\", \"flowview\"],\n        \"Resume all intercepted flows\",\n    )\n    km.add(\n        \"a\",\n        \"flow.resume @focus\",\n        [\"flowlist\", \"flowview\"],\n        \"Resume this intercepted flow\",\n    )\n    km.add(\n        \"b\",\n        \"console.command cut.save @focus response.content \",\n        [\"flowlist\", \"flowview\"],\n        \"Save response body to file\",\n    )\n    km.add(\n        \"d\",\n        \"view.flows.remove @focus\",\n        [\"flowlist\", \"flowview\"],\n        \"Delete flow from view\",\n    )\n    km.add(\n        \"D\", \"view.flows.duplicate @focus\", [\"flowlist\", \"flowview\"], \"Duplicate flow\"\n    )\n    km.add(\n        \"e\",\n        \"\"\"\n        console.choose.cmd Format export.formats\n        console.command export.file {choice} @focus\n        \"\"\",\n        [\"flowlist\", \"flowview\"],\n        \"Export this flow to file\",\n    )\n    km.add(\"f\", \"console.command.set view_filter\", [\"flowlist\"], \"Set view filter\")\n    km.add(\"F\", \"set console_focus_follow toggle\", [\"flowlist\"], \"Set focus follow\")\n    km.add(\n        \"ctrl l\",\n        \"console.command cut.clip \",\n        [\"flowlist\", \"flowview\"],\n        \"Send cuts to clipboard\",\n    )\n    km.add(\n        \"L\", \"console.command view.flows.load \", [\"flowlist\"], \"Load flows from file\"\n    )\n    km.add(\"m\", \"flow.mark.toggle @focus\", [\"flowlist\"], \"Toggle mark on this flow\")\n    km.add(\n        \"M\",\n        \"view.properties.marked.toggle\",\n        [\"flowlist\"],\n        \"Toggle viewing marked flows\",\n    )\n    km.add(\n        \"n\",\n        \"console.command view.flows.create get https://example.com/\",\n        [\"flowlist\"],\n        \"Create a new flow\",\n    )\n    km.add(\n        \"o\",\n        \"\"\"\n        console.choose.cmd Order view.order.options\n        set view_order {choice}\n        \"\"\",\n        [\"flowlist\"],\n        \"Set flow list order\",\n    )\n    km.add(\"r\", \"replay.client @focus\", [\"flowlist\", \"flowview\"], \"Replay this flow\")\n    km.add(\"S\", \"console.command replay.server \", [\"flowlist\"], \"Start server replay\")\n    km.add(\n        \"v\", \"set view_order_reversed toggle\", [\"flowlist\"], \"Reverse flow list order\"\n    )\n    km.add(\"U\", \"flow.mark @all false\", [\"flowlist\"], \"Un-set all marks\")\n    km.add(\n        \"w\",\n        \"console.command save.file @shown \",\n        [\"flowlist\"],\n        \"Save listed flows to file\",\n    )\n    km.add(\n        \"V\",\n        \"flow.revert @focus\",\n        [\"flowlist\", \"flowview\"],\n        \"Revert changes to this flow\",\n    )\n    km.add(\"X\", \"flow.kill @focus\", [\"flowlist\"], \"Kill this flow\")\n    km.add(\"z\", \"view.flows.remove @all\", [\"flowlist\"], \"Clear flow list\")\n    km.add(\n        \"Z\", \"view.flows.remove @hidden\", [\"flowlist\"], \"Purge all flows not showing\"\n    )\n    km.add(\n        \"|\",\n        \"console.command script.run @focus \",\n        [\"flowlist\", \"flowview\"],\n        \"Run a script on this flow\",\n    )\n\n    km.add(\n        \"e\",\n        \"\"\"\n        console.choose.cmd Part console.edit.focus.options\n        console.edit.focus {choice}\n        \"\"\",\n        [\"flowview\"],\n        \"Edit a flow component\",\n    )\n    km.add(\n        \"f\",\n        \"view.settings.setval.toggle @focus fullcontents\",\n        [\"flowview\"],\n        \"Toggle viewing full contents on this flow\",\n    )\n    km.add(\"w\", \"console.command save.file @focus \", [\"flowview\"], \"Save flow to file\")\n    km.add(\"space\", \"view.focus.next\", [\"flowview\"], \"Go to next flow\")\n\n    km.add(\n        \"v\",\n        \"\"\"\n        console.choose \"View Part\" request,response\n        console.bodyview @focus {choice}\n        \"\"\",\n        [\"flowview\"],\n        \"View flow body in an external viewer\",\n    )\n    km.add(\"p\", \"view.focus.prev\", [\"flowview\"], \"Go to previous flow\")\n    km.add(\n        \"m\",\n        \"\"\"\n        console.choose.cmd Mode console.flowview.mode.options\n        console.flowview.mode.set {choice}\n        \"\"\",\n        [\"flowview\"],\n        \"Set flow view mode\",\n    )\n    km.add(\n        \"z\",\n        \"\"\"\n        console.choose \"Part\" request,response\n        flow.encode.toggle @focus {choice}\n        \"\"\",\n        [\"flowview\"],\n        \"Encode/decode flow body\",\n    )\n\n    km.add(\"L\", \"console.command options.load \", [\"options\"], \"Load from file\")\n    km.add(\"S\", \"console.command options.save \", [\"options\"], \"Save to file\")\n    km.add(\"D\", \"options.reset\", [\"options\"], \"Reset all options\")\n    km.add(\"d\", \"console.options.reset.focus\", [\"options\"], \"Reset this option\")\n\n    km.add(\"a\", \"console.grideditor.add\", [\"grideditor\"], \"Add a row after cursor\")\n    km.add(\n        \"A\", \"console.grideditor.insert\", [\"grideditor\"], \"Insert a row before cursor\"\n    )\n    km.add(\"d\", \"console.grideditor.delete\", [\"grideditor\"], \"Delete this row\")\n    km.add(\n        \"r\",\n        \"console.command console.grideditor.load\",\n        [\"grideditor\"],\n        \"Read unescaped data into the current cell from file\",\n    )\n    km.add(\n        \"R\",\n        \"console.command console.grideditor.load_escaped\",\n        [\"grideditor\"],\n        \"Load a Python-style escaped string into the current cell from file\",\n    )\n    km.add(\"e\", \"console.grideditor.editor\", [\"grideditor\"], \"Edit in external editor\")\n    km.add(\n        \"w\",\n        \"console.command console.grideditor.save \",\n        [\"grideditor\"],\n        \"Save data to file as CSV\",\n    )\n\n    km.add(\"z\", \"eventstore.clear\", [\"eventlog\"], \"Clear\")\n\n    km.add(\n        \"a\",\n        \"\"\"\n        console.choose.cmd \"Context\" console.key.contexts\n        console.command console.key.bind {choice}\n        \"\"\",\n        [\"keybindings\"],\n        \"Add a key binding\",\n    )\n    km.add(\n        \"d\",\n        \"console.key.unbind.focus\",\n        [\"keybindings\"],\n        \"Unbind the currently focused key binding\",\n    )\n    km.add(\n        \"x\",\n        \"console.key.execute.focus\",\n        [\"keybindings\"],\n        \"Execute the currently focused key binding\",\n    )\n    km.add(\n        \"enter\",\n        \"console.key.edit.focus\",\n        [\"keybindings\"],\n        \"Edit the currently focused key binding\",\n    )\n", "path": "mitmproxy/tools/console/defaultkeys.py"}], "after_files": [{"content": "from mitmproxy.tools.console.keymap import Keymap\n\n\ndef map(km: Keymap) -> None:\n    km.add(\":\", \"console.command \", [\"commonkey\", \"global\"], \"Command prompt\")\n    km.add(\n        \";\",\n        \"console.command flow.comment @focus ''\",\n        [\"flowlist\", \"flowview\"],\n        \"Add comment to flow\",\n    )\n    km.add(\"?\", \"console.view.help\", [\"global\"], \"View help\")\n    km.add(\"B\", \"browser.start\", [\"global\"], \"Start an attached browser\")\n    km.add(\"C\", \"console.view.commands\", [\"global\"], \"View commands\")\n    km.add(\"K\", \"console.view.keybindings\", [\"global\"], \"View key bindings\")\n    km.add(\"O\", \"console.view.options\", [\"commonkey\", \"global\"], \"View options\")\n    km.add(\"E\", \"console.view.eventlog\", [\"commonkey\", \"global\"], \"View event log\")\n    km.add(\"Q\", \"console.exit\", [\"global\"], \"Exit immediately\")\n    km.add(\"q\", \"console.view.pop\", [\"commonkey\", \"global\"], \"Exit the current view\")\n    km.add(\"-\", \"console.layout.cycle\", [\"global\"], \"Cycle to next layout\")\n    km.add(\"ctrl right\", \"console.panes.next\", [\"global\"], \"Focus next layout pane\")\n    km.add(\"ctrl left\", \"console.panes.prev\", [\"global\"], \"Focus previous layout pane\")\n    km.add(\"shift tab\", \"console.panes.next\", [\"global\"], \"Focus next layout pane\")\n    km.add(\"P\", \"console.view.flow @focus\", [\"global\"], \"View flow details\")\n\n    km.add(\"?\", \"console.view.pop\", [\"help\"], \"Exit help\")\n\n    km.add(\"g\", \"console.nav.start\", [\"global\"], \"Go to start\")\n    km.add(\"G\", \"console.nav.end\", [\"global\"], \"Go to end\")\n    km.add(\"k\", \"console.nav.up\", [\"global\"], \"Up\")\n    km.add(\"j\", \"console.nav.down\", [\"global\"], \"Down\")\n    km.add(\"l\", \"console.nav.right\", [\"global\"], \"Right\")\n    km.add(\"h\", \"console.nav.left\", [\"global\"], \"Left\")\n    km.add(\"tab\", \"console.nav.next\", [\"commonkey\", \"global\"], \"Next\")\n    km.add(\"enter\", \"console.nav.select\", [\"commonkey\", \"global\"], \"Select\")\n    km.add(\"space\", \"console.nav.pagedown\", [\"global\"], \"Page down\")\n    km.add(\"ctrl f\", \"console.nav.pagedown\", [\"global\"], \"Page down\")\n    km.add(\"ctrl b\", \"console.nav.pageup\", [\"global\"], \"Page up\")\n\n    km.add(\n        \"I\",\n        \"set intercept_active toggle\",\n        [\"global\"],\n        \"Toggle whether the filtering via the intercept option is enabled\",\n    )\n    km.add(\"i\", \"console.command.set intercept\", [\"global\"], \"Set intercept\")\n    km.add(\"W\", \"console.command.set save_stream_file\", [\"global\"], \"Stream to file\")\n    km.add(\n        \"A\",\n        \"flow.resume @all\",\n        [\"flowlist\", \"flowview\"],\n        \"Resume all intercepted flows\",\n    )\n    km.add(\n        \"a\",\n        \"flow.resume @focus\",\n        [\"flowlist\", \"flowview\"],\n        \"Resume this intercepted flow\",\n    )\n    km.add(\n        \"b\",\n        \"console.command cut.save @focus response.content \",\n        [\"flowlist\", \"flowview\"],\n        \"Save response body to file\",\n    )\n    km.add(\n        \"d\",\n        \"view.flows.remove @focus\",\n        [\"flowlist\", \"flowview\"],\n        \"Delete flow from view\",\n    )\n    km.add(\n        \"D\", \"view.flows.duplicate @focus\", [\"flowlist\", \"flowview\"], \"Duplicate flow\"\n    )\n    km.add(\n        \"e\",\n        \"\"\"\n        console.choose.cmd Format export.formats\n        console.command export.file {choice} @focus\n        \"\"\",\n        [\"flowlist\", \"flowview\"],\n        \"Export this flow to file\",\n    )\n    km.add(\"f\", \"console.command.set view_filter\", [\"flowlist\"], \"Set view filter\")\n    km.add(\n        \"F\",\n        \"set console_focus_follow toggle\",\n        [\"flowlist\", \"flowview\"],\n        \"Set focus follow\",\n    )\n    km.add(\n        \"ctrl l\",\n        \"console.command cut.clip \",\n        [\"flowlist\", \"flowview\"],\n        \"Send cuts to clipboard\",\n    )\n    km.add(\n        \"L\", \"console.command view.flows.load \", [\"flowlist\"], \"Load flows from file\"\n    )\n    km.add(\"m\", \"flow.mark.toggle @focus\", [\"flowlist\"], \"Toggle mark on this flow\")\n    km.add(\n        \"M\",\n        \"view.properties.marked.toggle\",\n        [\"flowlist\"],\n        \"Toggle viewing marked flows\",\n    )\n    km.add(\n        \"n\",\n        \"console.command view.flows.create get https://example.com/\",\n        [\"flowlist\"],\n        \"Create a new flow\",\n    )\n    km.add(\n        \"o\",\n        \"\"\"\n        console.choose.cmd Order view.order.options\n        set view_order {choice}\n        \"\"\",\n        [\"flowlist\"],\n        \"Set flow list order\",\n    )\n    km.add(\"r\", \"replay.client @focus\", [\"flowlist\", \"flowview\"], \"Replay this flow\")\n    km.add(\"S\", \"console.command replay.server \", [\"flowlist\"], \"Start server replay\")\n    km.add(\n        \"v\", \"set view_order_reversed toggle\", [\"flowlist\"], \"Reverse flow list order\"\n    )\n    km.add(\"U\", \"flow.mark @all false\", [\"flowlist\"], \"Un-set all marks\")\n    km.add(\n        \"w\",\n        \"console.command save.file @shown \",\n        [\"flowlist\"],\n        \"Save listed flows to file\",\n    )\n    km.add(\n        \"V\",\n        \"flow.revert @focus\",\n        [\"flowlist\", \"flowview\"],\n        \"Revert changes to this flow\",\n    )\n    km.add(\"X\", \"flow.kill @focus\", [\"flowlist\"], \"Kill this flow\")\n    km.add(\"z\", \"view.flows.remove @all\", [\"flowlist\"], \"Clear flow list\")\n    km.add(\n        \"Z\", \"view.flows.remove @hidden\", [\"flowlist\"], \"Purge all flows not showing\"\n    )\n    km.add(\n        \"|\",\n        \"console.command script.run @focus \",\n        [\"flowlist\", \"flowview\"],\n        \"Run a script on this flow\",\n    )\n\n    km.add(\n        \"e\",\n        \"\"\"\n        console.choose.cmd Part console.edit.focus.options\n        console.edit.focus {choice}\n        \"\"\",\n        [\"flowview\"],\n        \"Edit a flow component\",\n    )\n    km.add(\n        \"f\",\n        \"view.settings.setval.toggle @focus fullcontents\",\n        [\"flowview\"],\n        \"Toggle viewing full contents on this flow\",\n    )\n    km.add(\"w\", \"console.command save.file @focus \", [\"flowview\"], \"Save flow to file\")\n    km.add(\"space\", \"view.focus.next\", [\"flowview\"], \"Go to next flow\")\n\n    km.add(\n        \"v\",\n        \"\"\"\n        console.choose \"View Part\" request,response\n        console.bodyview @focus {choice}\n        \"\"\",\n        [\"flowview\"],\n        \"View flow body in an external viewer\",\n    )\n    km.add(\"p\", \"view.focus.prev\", [\"flowview\"], \"Go to previous flow\")\n    km.add(\n        \"m\",\n        \"\"\"\n        console.choose.cmd Mode console.flowview.mode.options\n        console.flowview.mode.set {choice}\n        \"\"\",\n        [\"flowview\"],\n        \"Set flow view mode\",\n    )\n    km.add(\n        \"z\",\n        \"\"\"\n        console.choose \"Part\" request,response\n        flow.encode.toggle @focus {choice}\n        \"\"\",\n        [\"flowview\"],\n        \"Encode/decode flow body\",\n    )\n\n    km.add(\"L\", \"console.command options.load \", [\"options\"], \"Load from file\")\n    km.add(\"S\", \"console.command options.save \", [\"options\"], \"Save to file\")\n    km.add(\"D\", \"options.reset\", [\"options\"], \"Reset all options\")\n    km.add(\"d\", \"console.options.reset.focus\", [\"options\"], \"Reset this option\")\n\n    km.add(\"a\", \"console.grideditor.add\", [\"grideditor\"], \"Add a row after cursor\")\n    km.add(\n        \"A\", \"console.grideditor.insert\", [\"grideditor\"], \"Insert a row before cursor\"\n    )\n    km.add(\"d\", \"console.grideditor.delete\", [\"grideditor\"], \"Delete this row\")\n    km.add(\n        \"r\",\n        \"console.command console.grideditor.load\",\n        [\"grideditor\"],\n        \"Read unescaped data into the current cell from file\",\n    )\n    km.add(\n        \"R\",\n        \"console.command console.grideditor.load_escaped\",\n        [\"grideditor\"],\n        \"Load a Python-style escaped string into the current cell from file\",\n    )\n    km.add(\"e\", \"console.grideditor.editor\", [\"grideditor\"], \"Edit in external editor\")\n    km.add(\n        \"w\",\n        \"console.command console.grideditor.save \",\n        [\"grideditor\"],\n        \"Save data to file as CSV\",\n    )\n\n    km.add(\"z\", \"eventstore.clear\", [\"eventlog\"], \"Clear\")\n\n    km.add(\n        \"a\",\n        \"\"\"\n        console.choose.cmd \"Context\" console.key.contexts\n        console.command console.key.bind {choice}\n        \"\"\",\n        [\"keybindings\"],\n        \"Add a key binding\",\n    )\n    km.add(\n        \"d\",\n        \"console.key.unbind.focus\",\n        [\"keybindings\"],\n        \"Unbind the currently focused key binding\",\n    )\n    km.add(\n        \"x\",\n        \"console.key.execute.focus\",\n        [\"keybindings\"],\n        \"Execute the currently focused key binding\",\n    )\n    km.add(\n        \"enter\",\n        \"console.key.edit.focus\",\n        [\"keybindings\"],\n        \"Edit the currently focused key binding\",\n    )\n", "path": "mitmproxy/tools/console/defaultkeys.py"}]}