MCPcopy
hub / github.com/mitmproxy/mitmproxy / get_editor

Method get_editor

mitmproxy/tools/console/master.py:113–125  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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"]

Callers 2

get_hex_editorMethod · 0.95
spawn_editorMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected