Repository: mitmproxy/mitmproxy

Issue:
Crash when pressing F with eventlog focused
##### Steps to reproduce the problem:

1. Start mitmproxy (console UI).
2. Press E to show the eventlog.
3. Press Tab to focus the eventlog.
4. Press F.

```
Traceback (most recent call last):
  File "/home/vasiliy/tmp/env4/lib/python3.5/site-packages/mitmproxy/tools/console/master.py", line 281, in run
    self.loop.run()
  File "/home/vasiliy/tmp/env4/lib/python3.5/site-packages/urwid/main_loop.py", line 278, in run
    self._run()
  File "/home/vasiliy/tmp/env4/lib/python3.5/site-packages/urwid/main_loop.py", line 376, in _run
    self.event_loop.run()
  File "/home/vasiliy/tmp/env4/lib/python3.5/site-packages/urwid/main_loop.py", line 682, in run
    self._loop()
  File "/home/vasiliy/tmp/env4/lib/python3.5/site-packages/urwid/main_loop.py", line 719, in _loop
    self._watch_files[fd]()
  File "/home/vasiliy/tmp/env4/lib/python3.5/site-packages/urwid/raw_display.py", line 393, in <lambda>
    event_loop, callback, self.get_available_raw_input())
  File "/home/vasiliy/tmp/env4/lib/python3.5/site-packages/urwid/raw_display.py", line 493, in parse_input
    callback(processed, processed_codes)
  File "/home/vasiliy/tmp/env4/lib/python3.5/site-packages/urwid/main_loop.py", line 403, in _update
    self.process_input(keys)
  File "/home/vasiliy/tmp/env4/lib/python3.5/site-packages/urwid/main_loop.py", line 503, in process_input
    k = self._topmost_widget.keypress(self.screen_size, k)
  File "/home/vasiliy/tmp/env4/lib/python3.5/site-packages/mitmproxy/tools/console/window.py", line 84, in keypress
    k = super().keypress(size, k)
  File "/home/vasiliy/tmp/env4/lib/python3.5/site-packages/urwid/container.py", line 1128, in keypress
    return self.body.keypress( (maxcol, remaining), key )
  File "/home/vasiliy/tmp/env4/lib/python3.5/site-packages/mitmproxy/tools/console/flowlist.py", line 116, in keypress
    return self.focus_item.keypress(tsize, key)
  File "/home/vasiliy/tmp/env4/lib/python3.5/site-packages/urwid/container.py", line 1128, in keypress
    return self.body.keypress( (maxcol, remaining), key )
  File "/home/vasiliy/tmp/env4/lib/python3.5/site-packages/mitmproxy/tools/console/flowlist.py", line 71, in keypress
    o.focus_follow = not o.focus_follow
  File "/home/vasiliy/tmp/env4/lib/python3.5/site-packages/mitmproxy/optmanager.py", line 107, in __getattr__
    raise AttributeError("No such option: %s" % attr)
AttributeError: No such option: focus_follow

mitmproxy has crashed!
Please lodge a bug report at:
	https://github.com/mitmproxy/mitmproxy
Shutting down...
```


##### System information

(this is mitmproxy from master)

Mitmproxy version: 3.0.0 (release version) 
Python version: 3.5.2
Platform: Linux-4.4.0-64-generic-x86_64-with-Ubuntu-16.04-xenial
SSL version: OpenSSL 1.0.2g  1 Mar 2016
Linux distro: Ubuntu 16.04 xenial



Discussion:
I'm looking into it 
On first look, it seems like `o.focus_follow = not o.focus_follow` should be `o.console_focus_follow = not o.console_focus_follow`

Resolving patch:
diff --git a/mitmproxy/tools/console/flowlist.py b/mitmproxy/tools/console/flowlist.py
--- a/mitmproxy/tools/console/flowlist.py
+++ b/mitmproxy/tools/console/flowlist.py
@@ -68,7 +68,7 @@ def keypress(self, size, key):
             self.set_focus(0)
         elif key == "F":
             o = self.master.options
-            o.focus_follow = not o.focus_follow
+            o.console_focus_follow = not o.console_focus_follow
         return urwid.ListBox.keypress(self, size, key)
 
 


Test patch: