We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
View response in Firefox gives file not found
#### Problem Description
Hitting `v` on a flow opens up firefox pointing to a temp mitmproxy file but the file doesn't exist

#### Steps to reproduce the behavior:
1. Capture a request 
2. Press v in the flow view of request and 2 for viewing response
3. Firefox opens up to view the response html page but only displays file not found e.g. `Firefox can’t find the file at /tmp/mproxynqb8uytn.html`. (Hitting `e` and editing the response works correctly and opens up the response as a tmp file in my editor)

#### System Information
Mitmproxy: 5.1.1
Python:    3.8.3
OpenSSL:   OpenSSL 1.1.1g  21 Apr 2020
Platform:  Linux-5.6.19-2-MANJARO-x86_64-with-glibc2.2.5


--- 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/master.py`
Content:
```
1 import asyncio
2 import mailcap
3 import mimetypes
4 import os
5 import os.path
6 import shlex
7 import signal
8 import stat
9 import subprocess
10 import sys
11 import tempfile
12 import typing  # noqa
13 import contextlib
14 
15 import urwid
16 
17 from mitmproxy import addons
18 from mitmproxy import master
19 from mitmproxy import log
20 from mitmproxy.addons import intercept
21 from mitmproxy.addons import eventstore
22 from mitmproxy.addons import readfile
23 from mitmproxy.addons import view
24 from mitmproxy.tools.console import consoleaddons
25 from mitmproxy.tools.console import defaultkeys
26 from mitmproxy.tools.console import keymap
27 from mitmproxy.tools.console import palettes
28 from mitmproxy.tools.console import signals
29 from mitmproxy.tools.console import window
30 
31 
32 class ConsoleMaster(master.Master):
33 
34     def __init__(self, opts):
35         super().__init__(opts)
36 
37         self.start_err: typing.Optional[log.LogEntry] = None
38 
39         self.view: view.View = view.View()
40         self.events = eventstore.EventStore()
41         self.events.sig_add.connect(self.sig_add_log)
42 
43         self.stream_path = None
44         self.keymap = keymap.Keymap(self)
45         defaultkeys.map(self.keymap)
46         self.options.errored.connect(self.options_error)
47 
48         self.view_stack = []
49 
50         signals.call_in.connect(self.sig_call_in)
51         self.addons.add(*addons.default_addons())
52         self.addons.add(
53             intercept.Intercept(),
54             self.view,
55             self.events,
56             consoleaddons.UnsupportedLog(),
57             readfile.ReadFile(),
58             consoleaddons.ConsoleAddon(self),
59             keymap.KeymapConfig(),
60         )
61 
62         def sigint_handler(*args, **kwargs):
63             self.prompt_for_exit()
64 
65         signal.signal(signal.SIGINT, sigint_handler)
66 
67         self.window = None
68 
69     def __setattr__(self, name, value):
70         super().__setattr__(name, value)
71         signals.update_settings.send(self)
72 
73     def options_error(self, opts, exc):
74         signals.status_message.send(
75             message=str(exc),
76             expire=1
77         )
78 
79     def prompt_for_exit(self):
80         signals.status_prompt_onekey.send(
81             self,
82             prompt = "Quit",
83             keys = (
84                 ("yes", "y"),
85                 ("no", "n"),
86             ),
87             callback = self.quit,
88         )
89 
90     def sig_add_log(self, event_store, entry: log.LogEntry):
91         if log.log_tier(self.options.console_eventlog_verbosity) < log.log_tier(entry.level):
92             return
93         if entry.level in ("error", "warn", "alert"):
94             signals.status_message.send(
95                 message = (
96                     entry.level,
97                     "{}: {}".format(entry.level.title(), str(entry.msg).lstrip())
98                 ),
99                 expire=5
100             )
101 
102     def sig_call_in(self, sender, seconds, callback, args=()):
103         def cb(*_):
104             return callback(*args)
105         self.loop.set_alarm_in(seconds, cb)
106 
107     @contextlib.contextmanager
108     def uistopped(self):
109         self.loop.stop()
110         try:
111             yield
112         finally:
113             self.loop.start()
114             self.loop.screen_size = None
115             self.loop.draw_screen()
116 
117     def spawn_editor(self, data):
118         text = not isinstance(data, bytes)
119         fd, name = tempfile.mkstemp('', "mproxy", text=text)
120         with open(fd, "w" if text else "wb") as f:
121             f.write(data)
122         # if no EDITOR is set, assume 'vi'
123         c = os.environ.get("MITMPROXY_EDITOR") or os.environ.get("EDITOR") or "vi"
124         cmd = shlex.split(c)
125         cmd.append(name)
126         with self.uistopped():
127             try:
128                 subprocess.call(cmd)
129             except:
130                 signals.status_message.send(
131                     message="Can't start editor: %s" % c
132                 )
133             else:
134                 with open(name, "r" if text else "rb") as f:
135                     data = f.read()
136         os.unlink(name)
137         return data
138 
139     def spawn_external_viewer(self, data, contenttype):
140         if contenttype:
141             contenttype = contenttype.split(";")[0]
142             ext = mimetypes.guess_extension(contenttype) or ""
143         else:
144             ext = ""
145         fd, name = tempfile.mkstemp(ext, "mproxy")
146         os.write(fd, data)
147         os.close(fd)
148 
149         # read-only to remind the user that this is a view function
150         os.chmod(name, stat.S_IREAD)
151 
152         cmd = None
153         shell = False
154 
155         if contenttype:
156             c = mailcap.getcaps()
157             cmd, _ = mailcap.findmatch(c, contenttype, filename=name)
158             if cmd:
159                 shell = True
160         if not cmd:
161             # hm which one should get priority?
162             c = os.environ.get("MITMPROXY_EDITOR") or os.environ.get("PAGER") or os.environ.get("EDITOR")
163             if not c:
164                 c = "less"
165             cmd = shlex.split(c)
166             cmd.append(name)
167         with self.uistopped():
168             try:
169                 subprocess.call(cmd, shell=shell)
170             except:
171                 signals.status_message.send(
172                     message="Can't start external viewer: %s" % " ".join(c)
173                 )
174         os.unlink(name)
175 
176     def set_palette(self, opts, updated):
177         self.ui.register_palette(
178             palettes.palettes[opts.console_palette].palette(
179                 opts.console_palette_transparent
180             )
181         )
182         self.ui.clear()
183 
184     def inject_key(self, key):
185         self.loop.process_input([key])
186 
187     def run(self):
188         if not sys.stdout.isatty():
189             print("Error: mitmproxy's console interface requires a tty. "
190                   "Please run mitmproxy in an interactive shell environment.", file=sys.stderr)
191             sys.exit(1)
192 
193         self.ui = window.Screen()
194         self.ui.set_terminal_properties(256)
195         self.set_palette(self.options, None)
196         self.options.subscribe(
197             self.set_palette,
198             ["console_palette", "console_palette_transparent"]
199         )
200         self.loop = urwid.MainLoop(
201             urwid.SolidFill("x"),
202             event_loop=urwid.AsyncioEventLoop(loop=asyncio.get_event_loop()),
203             screen = self.ui,
204             handle_mouse = self.options.console_mouse,
205         )
206         self.window = window.Window(self)
207         self.loop.widget = self.window
208         self.window.refresh()
209 
210         if self.start_err:
211             def display_err(*_):
212                 self.sig_add_log(None, self.start_err)
213                 self.start_err = None
214             self.loop.set_alarm_in(0.01, display_err)
215 
216         super().run_loop(self.loop.run)
217 
218     def overlay(self, widget, **kwargs):
219         self.window.set_overlay(widget, **kwargs)
220 
221     def switch_view(self, name):
222         self.window.push(name)
223 
224     def quit(self, a):
225         if a != "n":
226             self.shutdown()
227
```
--- 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/master.py b/mitmproxy/tools/console/master.py
--- a/mitmproxy/tools/console/master.py
+++ b/mitmproxy/tools/console/master.py
@@ -11,6 +11,7 @@
 import tempfile
 import typing  # noqa
 import contextlib
+import threading
 
 import urwid
 
@@ -171,7 +172,9 @@
                 signals.status_message.send(
                     message="Can't start external viewer: %s" % " ".join(c)
                 )
-        os.unlink(name)
+        # add a small delay before deletion so that the file is not removed before being loaded by the viewer
+        t = threading.Timer(1.0, os.unlink, args=[name])
+        t.start()
 
     def set_palette(self, opts, updated):
         self.ui.register_palette(

{"golden_diff": "diff --git a/mitmproxy/tools/console/master.py b/mitmproxy/tools/console/master.py\n--- a/mitmproxy/tools/console/master.py\n+++ b/mitmproxy/tools/console/master.py\n@@ -11,6 +11,7 @@\n import tempfile\n import typing  # noqa\n import contextlib\n+import threading\n \n import urwid\n \n@@ -171,7 +172,9 @@\n                 signals.status_message.send(\n                     message=\"Can't start external viewer: %s\" % \" \".join(c)\n                 )\n-        os.unlink(name)\n+        # add a small delay before deletion so that the file is not removed before being loaded by the viewer\n+        t = threading.Timer(1.0, os.unlink, args=[name])\n+        t.start()\n \n     def set_palette(self, opts, updated):\n         self.ui.register_palette(\n", "issue": "View response in Firefox gives file not found\n#### Problem Description\r\nHitting `v` on a flow opens up firefox pointing to a temp mitmproxy file but the file doesn't exist\r\n\r\n#### Steps to reproduce the behavior:\r\n1. Capture a request \r\n2. Press v in the flow view of request and 2 for viewing response\r\n3. Firefox opens up to view the response html page but only displays file not found e.g. `Firefox can\u2019t find the file at /tmp/mproxynqb8uytn.html`. (Hitting `e` and editing the response works correctly and opens up the response as a tmp file in my editor)\r\n\r\n#### System Information\r\nMitmproxy: 5.1.1\r\nPython:    3.8.3\r\nOpenSSL:   OpenSSL 1.1.1g  21 Apr 2020\r\nPlatform:  Linux-5.6.19-2-MANJARO-x86_64-with-glibc2.2.5\r\n\n", "before_files": [{"content": "import asyncio\nimport mailcap\nimport mimetypes\nimport os\nimport os.path\nimport shlex\nimport signal\nimport stat\nimport subprocess\nimport sys\nimport tempfile\nimport typing  # noqa\nimport contextlib\n\nimport urwid\n\nfrom mitmproxy import addons\nfrom mitmproxy import master\nfrom mitmproxy import log\nfrom mitmproxy.addons import intercept\nfrom mitmproxy.addons import eventstore\nfrom mitmproxy.addons import readfile\nfrom mitmproxy.addons import view\nfrom mitmproxy.tools.console import consoleaddons\nfrom mitmproxy.tools.console import defaultkeys\nfrom mitmproxy.tools.console import keymap\nfrom mitmproxy.tools.console import palettes\nfrom mitmproxy.tools.console import signals\nfrom mitmproxy.tools.console import window\n\n\nclass ConsoleMaster(master.Master):\n\n    def __init__(self, opts):\n        super().__init__(opts)\n\n        self.start_err: typing.Optional[log.LogEntry] = None\n\n        self.view: view.View = view.View()\n        self.events = eventstore.EventStore()\n        self.events.sig_add.connect(self.sig_add_log)\n\n        self.stream_path = None\n        self.keymap = keymap.Keymap(self)\n        defaultkeys.map(self.keymap)\n        self.options.errored.connect(self.options_error)\n\n        self.view_stack = []\n\n        signals.call_in.connect(self.sig_call_in)\n        self.addons.add(*addons.default_addons())\n        self.addons.add(\n            intercept.Intercept(),\n            self.view,\n            self.events,\n            consoleaddons.UnsupportedLog(),\n            readfile.ReadFile(),\n            consoleaddons.ConsoleAddon(self),\n            keymap.KeymapConfig(),\n        )\n\n        def sigint_handler(*args, **kwargs):\n            self.prompt_for_exit()\n\n        signal.signal(signal.SIGINT, sigint_handler)\n\n        self.window = None\n\n    def __setattr__(self, name, value):\n        super().__setattr__(name, value)\n        signals.update_settings.send(self)\n\n    def options_error(self, opts, exc):\n        signals.status_message.send(\n            message=str(exc),\n            expire=1\n        )\n\n    def prompt_for_exit(self):\n        signals.status_prompt_onekey.send(\n            self,\n            prompt = \"Quit\",\n            keys = (\n                (\"yes\", \"y\"),\n                (\"no\", \"n\"),\n            ),\n            callback = self.quit,\n        )\n\n    def sig_add_log(self, event_store, entry: log.LogEntry):\n        if log.log_tier(self.options.console_eventlog_verbosity) < log.log_tier(entry.level):\n            return\n        if entry.level in (\"error\", \"warn\", \"alert\"):\n            signals.status_message.send(\n                message = (\n                    entry.level,\n                    \"{}: {}\".format(entry.level.title(), str(entry.msg).lstrip())\n                ),\n                expire=5\n            )\n\n    def sig_call_in(self, sender, seconds, callback, args=()):\n        def cb(*_):\n            return callback(*args)\n        self.loop.set_alarm_in(seconds, cb)\n\n    @contextlib.contextmanager\n    def uistopped(self):\n        self.loop.stop()\n        try:\n            yield\n        finally:\n            self.loop.start()\n            self.loop.screen_size = None\n            self.loop.draw_screen()\n\n    def spawn_editor(self, data):\n        text = not isinstance(data, bytes)\n        fd, name = tempfile.mkstemp('', \"mproxy\", text=text)\n        with open(fd, \"w\" if text else \"wb\") as f:\n            f.write(data)\n        # if no EDITOR is set, assume 'vi'\n        c = os.environ.get(\"MITMPROXY_EDITOR\") or os.environ.get(\"EDITOR\") or \"vi\"\n        cmd = shlex.split(c)\n        cmd.append(name)\n        with self.uistopped():\n            try:\n                subprocess.call(cmd)\n            except:\n                signals.status_message.send(\n                    message=\"Can't start editor: %s\" % c\n                )\n            else:\n                with open(name, \"r\" if text else \"rb\") as f:\n                    data = f.read()\n        os.unlink(name)\n        return data\n\n    def spawn_external_viewer(self, data, contenttype):\n        if contenttype:\n            contenttype = contenttype.split(\";\")[0]\n            ext = mimetypes.guess_extension(contenttype) or \"\"\n        else:\n            ext = \"\"\n        fd, name = tempfile.mkstemp(ext, \"mproxy\")\n        os.write(fd, data)\n        os.close(fd)\n\n        # read-only to remind the user that this is a view function\n        os.chmod(name, stat.S_IREAD)\n\n        cmd = None\n        shell = False\n\n        if contenttype:\n            c = mailcap.getcaps()\n            cmd, _ = mailcap.findmatch(c, contenttype, filename=name)\n            if cmd:\n                shell = True\n        if not cmd:\n            # hm which one should get priority?\n            c = os.environ.get(\"MITMPROXY_EDITOR\") or os.environ.get(\"PAGER\") or os.environ.get(\"EDITOR\")\n            if not c:\n                c = \"less\"\n            cmd = shlex.split(c)\n            cmd.append(name)\n        with self.uistopped():\n            try:\n                subprocess.call(cmd, shell=shell)\n            except:\n                signals.status_message.send(\n                    message=\"Can't start external viewer: %s\" % \" \".join(c)\n                )\n        os.unlink(name)\n\n    def set_palette(self, opts, updated):\n        self.ui.register_palette(\n            palettes.palettes[opts.console_palette].palette(\n                opts.console_palette_transparent\n            )\n        )\n        self.ui.clear()\n\n    def inject_key(self, key):\n        self.loop.process_input([key])\n\n    def run(self):\n        if not sys.stdout.isatty():\n            print(\"Error: mitmproxy's console interface requires a tty. \"\n                  \"Please run mitmproxy in an interactive shell environment.\", file=sys.stderr)\n            sys.exit(1)\n\n        self.ui = window.Screen()\n        self.ui.set_terminal_properties(256)\n        self.set_palette(self.options, None)\n        self.options.subscribe(\n            self.set_palette,\n            [\"console_palette\", \"console_palette_transparent\"]\n        )\n        self.loop = urwid.MainLoop(\n            urwid.SolidFill(\"x\"),\n            event_loop=urwid.AsyncioEventLoop(loop=asyncio.get_event_loop()),\n            screen = self.ui,\n            handle_mouse = self.options.console_mouse,\n        )\n        self.window = window.Window(self)\n        self.loop.widget = self.window\n        self.window.refresh()\n\n        if self.start_err:\n            def display_err(*_):\n                self.sig_add_log(None, self.start_err)\n                self.start_err = None\n            self.loop.set_alarm_in(0.01, display_err)\n\n        super().run_loop(self.loop.run)\n\n    def overlay(self, widget, **kwargs):\n        self.window.set_overlay(widget, **kwargs)\n\n    def switch_view(self, name):\n        self.window.push(name)\n\n    def quit(self, a):\n        if a != \"n\":\n            self.shutdown()\n", "path": "mitmproxy/tools/console/master.py"}], "after_files": [{"content": "import asyncio\nimport mailcap\nimport mimetypes\nimport os\nimport os.path\nimport shlex\nimport signal\nimport stat\nimport subprocess\nimport sys\nimport tempfile\nimport typing  # noqa\nimport contextlib\nimport threading\n\nimport urwid\n\nfrom mitmproxy import addons\nfrom mitmproxy import master\nfrom mitmproxy import log\nfrom mitmproxy.addons import intercept\nfrom mitmproxy.addons import eventstore\nfrom mitmproxy.addons import readfile\nfrom mitmproxy.addons import view\nfrom mitmproxy.tools.console import consoleaddons\nfrom mitmproxy.tools.console import defaultkeys\nfrom mitmproxy.tools.console import keymap\nfrom mitmproxy.tools.console import palettes\nfrom mitmproxy.tools.console import signals\nfrom mitmproxy.tools.console import window\n\n\nclass ConsoleMaster(master.Master):\n\n    def __init__(self, opts):\n        super().__init__(opts)\n\n        self.start_err: typing.Optional[log.LogEntry] = None\n\n        self.view: view.View = view.View()\n        self.events = eventstore.EventStore()\n        self.events.sig_add.connect(self.sig_add_log)\n\n        self.stream_path = None\n        self.keymap = keymap.Keymap(self)\n        defaultkeys.map(self.keymap)\n        self.options.errored.connect(self.options_error)\n\n        self.view_stack = []\n\n        signals.call_in.connect(self.sig_call_in)\n        self.addons.add(*addons.default_addons())\n        self.addons.add(\n            intercept.Intercept(),\n            self.view,\n            self.events,\n            consoleaddons.UnsupportedLog(),\n            readfile.ReadFile(),\n            consoleaddons.ConsoleAddon(self),\n            keymap.KeymapConfig(),\n        )\n\n        def sigint_handler(*args, **kwargs):\n            self.prompt_for_exit()\n\n        signal.signal(signal.SIGINT, sigint_handler)\n\n        self.window = None\n\n    def __setattr__(self, name, value):\n        super().__setattr__(name, value)\n        signals.update_settings.send(self)\n\n    def options_error(self, opts, exc):\n        signals.status_message.send(\n            message=str(exc),\n            expire=1\n        )\n\n    def prompt_for_exit(self):\n        signals.status_prompt_onekey.send(\n            self,\n            prompt = \"Quit\",\n            keys = (\n                (\"yes\", \"y\"),\n                (\"no\", \"n\"),\n            ),\n            callback = self.quit,\n        )\n\n    def sig_add_log(self, event_store, entry: log.LogEntry):\n        if log.log_tier(self.options.console_eventlog_verbosity) < log.log_tier(entry.level):\n            return\n        if entry.level in (\"error\", \"warn\", \"alert\"):\n            signals.status_message.send(\n                message = (\n                    entry.level,\n                    \"{}: {}\".format(entry.level.title(), str(entry.msg).lstrip())\n                ),\n                expire=5\n            )\n\n    def sig_call_in(self, sender, seconds, callback, args=()):\n        def cb(*_):\n            return callback(*args)\n        self.loop.set_alarm_in(seconds, cb)\n\n    @contextlib.contextmanager\n    def uistopped(self):\n        self.loop.stop()\n        try:\n            yield\n        finally:\n            self.loop.start()\n            self.loop.screen_size = None\n            self.loop.draw_screen()\n\n    def spawn_editor(self, data):\n        text = not isinstance(data, bytes)\n        fd, name = tempfile.mkstemp('', \"mproxy\", text=text)\n        with open(fd, \"w\" if text else \"wb\") as f:\n            f.write(data)\n        # if no EDITOR is set, assume 'vi'\n        c = os.environ.get(\"MITMPROXY_EDITOR\") or os.environ.get(\"EDITOR\") or \"vi\"\n        cmd = shlex.split(c)\n        cmd.append(name)\n        with self.uistopped():\n            try:\n                subprocess.call(cmd)\n            except:\n                signals.status_message.send(\n                    message=\"Can't start editor: %s\" % c\n                )\n            else:\n                with open(name, \"r\" if text else \"rb\") as f:\n                    data = f.read()\n        os.unlink(name)\n        return data\n\n    def spawn_external_viewer(self, data, contenttype):\n        if contenttype:\n            contenttype = contenttype.split(\";\")[0]\n            ext = mimetypes.guess_extension(contenttype) or \"\"\n        else:\n            ext = \"\"\n        fd, name = tempfile.mkstemp(ext, \"mproxy\")\n        os.write(fd, data)\n        os.close(fd)\n\n        # read-only to remind the user that this is a view function\n        os.chmod(name, stat.S_IREAD)\n\n        cmd = None\n        shell = False\n\n        if contenttype:\n            c = mailcap.getcaps()\n            cmd, _ = mailcap.findmatch(c, contenttype, filename=name)\n            if cmd:\n                shell = True\n        if not cmd:\n            # hm which one should get priority?\n            c = os.environ.get(\"MITMPROXY_EDITOR\") or os.environ.get(\"PAGER\") or os.environ.get(\"EDITOR\")\n            if not c:\n                c = \"less\"\n            cmd = shlex.split(c)\n            cmd.append(name)\n        with self.uistopped():\n            try:\n                subprocess.call(cmd, shell=shell)\n            except:\n                signals.status_message.send(\n                    message=\"Can't start external viewer: %s\" % \" \".join(c)\n                )\n        # add a small delay before deletion so that the file is not removed before being loaded by the viewer\n        t = threading.Timer(1.0, os.unlink, args=[name])\n        t.start()\n\n    def set_palette(self, opts, updated):\n        self.ui.register_palette(\n            palettes.palettes[opts.console_palette].palette(\n                opts.console_palette_transparent\n            )\n        )\n        self.ui.clear()\n\n    def inject_key(self, key):\n        self.loop.process_input([key])\n\n    def run(self):\n        if not sys.stdout.isatty():\n            print(\"Error: mitmproxy's console interface requires a tty. \"\n                  \"Please run mitmproxy in an interactive shell environment.\", file=sys.stderr)\n            sys.exit(1)\n\n        self.ui = window.Screen()\n        self.ui.set_terminal_properties(256)\n        self.set_palette(self.options, None)\n        self.options.subscribe(\n            self.set_palette,\n            [\"console_palette\", \"console_palette_transparent\"]\n        )\n        self.loop = urwid.MainLoop(\n            urwid.SolidFill(\"x\"),\n            event_loop=urwid.AsyncioEventLoop(loop=asyncio.get_event_loop()),\n            screen = self.ui,\n            handle_mouse = self.options.console_mouse,\n        )\n        self.window = window.Window(self)\n        self.loop.widget = self.window\n        self.window.refresh()\n\n        if self.start_err:\n            def display_err(*_):\n                self.sig_add_log(None, self.start_err)\n                self.start_err = None\n            self.loop.set_alarm_in(0.01, display_err)\n\n        super().run_loop(self.loop.run)\n\n    def overlay(self, widget, **kwargs):\n        self.window.set_overlay(widget, **kwargs)\n\n    def switch_view(self, name):\n        self.window.push(name)\n\n    def quit(self, a):\n        if a != \"n\":\n            self.shutdown()\n", "path": "mitmproxy/tools/console/master.py"}]}