mirror of
https://github.com/zhigang1992/mitmproxy.git
synced 2026-03-26 08:54:48 +08:00
console: respect follow in eventlog
Also make it possible to toggle the option when the eventlog window has focus.
This commit is contained in:
committed by
Thomas Kriechbaumer
parent
48b6964552
commit
b39380b00f
@@ -65,6 +65,9 @@ class LogBufferBox(urwid.ListBox):
|
||||
self.set_focus(len(self.master.logbuffer) - 1)
|
||||
elif key == "g":
|
||||
self.set_focus(0)
|
||||
elif key == "F":
|
||||
o = self.master.options
|
||||
o.focus_follow = not o.focus_follow
|
||||
return urwid.ListBox.keypress(self, size, key)
|
||||
|
||||
|
||||
|
||||
@@ -108,7 +108,8 @@ class ConsoleMaster(master.Master):
|
||||
self.logbuffer.append(e)
|
||||
if len(self.logbuffer) > EVENTLOG_SIZE:
|
||||
self.logbuffer.pop(0)
|
||||
self.logbuffer.set_focus(len(self.logbuffer) - 1)
|
||||
if self.options.focus_follow:
|
||||
self.logbuffer.set_focus(len(self.logbuffer) - 1)
|
||||
|
||||
def sig_call_in(self, sender, seconds, callback, args=()):
|
||||
def cb(*_):
|
||||
|
||||
Reference in New Issue
Block a user