console: add command line flag to disable mouse interaction

Adds the --no-mouse command line option to disable the mouse.

Fixes #685
This commit is contained in:
Timothy Elliott 2015-08-19 13:07:39 -07:00
parent b8db81969d
commit fb4af4eb78
3 changed files with 9 additions and 2 deletions

View File

@ -608,6 +608,11 @@ def mitmproxy():
action="store_true", dest="eventlog",
help="Show event log."
)
parser.add_argument(
"--no-mouse",
action="store_true", dest="no_mouse",
help="Disable mouse interaction."
)
group = parser.add_argument_group(
"Filters",
"See help in mitmproxy for filter expression syntax."

View File

@ -154,7 +154,8 @@ class Options(object):
"wfile",
"nopop",
"palette",
"palette_transparent"
"palette_transparent",
"no_mouse"
]
def __init__(self, **kwargs):
@ -455,12 +456,12 @@ class ConsoleMaster(flow.FlowMaster):
def run(self):
self.ui = urwid.raw_display.Screen()
self.ui.set_mouse_tracking()
self.ui.set_terminal_properties(256)
self.set_palette(self.palette)
self.loop = urwid.MainLoop(
urwid.SolidFill("x"),
screen = self.ui,
handle_mouse = not self.options.no_mouse,
)
self.server.start_slave(

View File

@ -55,6 +55,7 @@ def mitmproxy(args=None): # pragma: nocover
console_options.eventlog = options.eventlog
console_options.intercept = options.intercept
console_options.limit = options.limit
console_options.no_mouse = options.no_mouse
server = get_server(console_options.no_server, proxy_config)