(self)
| 111 | self.loop.draw_screen() |
| 112 | |
| 113 | def get_editor(self) -> str: |
| 114 | # based upon https://github.com/pallets/click/blob/main/src/click/_termui_impl.py |
| 115 | if m := os.environ.get("MITMPROXY_EDITOR"): |
| 116 | return m |
| 117 | if m := os.environ.get("EDITOR"): |
| 118 | return m |
| 119 | for editor in "sensible-editor", "nano", "vim": |
| 120 | if shutil.which(editor): |
| 121 | return editor |
| 122 | if os.name == "nt": |
| 123 | return "notepad" |
| 124 | else: |
| 125 | return "vi" |
| 126 | |
| 127 | def get_hex_editor(self) -> str: |
| 128 | editors = ["ghex", "hexedit", "hxd", "hexer", "hexcurse"] |
no test coverage detected