summaryrefslogtreecommitdiff
path: root/alot/ui.py
diff options
context:
space:
mode:
authorJulian Mehne <julian.mehne@posteo.de>2018-01-24 01:34:03 +0100
committerJulian Mehne <julian.mehne@posteo.de>2018-02-01 01:34:17 +0100
commit09c969a8305ff920cece6cdde63ac1a97a210675 (patch)
tree04d297a28cc0ea33244bf116d69c5c186b3653b5 /alot/ui.py
parent7a37daee30c271e2aca7546bee910d419e4c2998 (diff)
Fix `LANG=C alot` with custom bindings.
Reproduction steps: - Set a custom binding in your config file. E.g.: [bindings] S = toggletags spam - start alot with LANG=C: LANG=C alot - variant A: type ö - variant B: type :search ö Problem: the urwid encoding is set to 'narrow', such that all key events are passed down as `str`, not `unicode`. At the same time, ConfigObj reads the custom binding as a unicode string. The interaction of both leads to crashes. Related to #673
Diffstat (limited to 'alot/ui.py')
-rw-r--r--alot/ui.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/alot/ui.py b/alot/ui.py
index f82feda4..3bb30ada 100644
--- a/alot/ui.py
+++ b/alot/ui.py
@@ -75,6 +75,9 @@ class UI(object):
# alarm handle for callback that clears input queue (to cancel alarm)
self._alarm = None
+ # force urwid to pass key events as unicode, independent of LANG
+ urwid.set_encoding('utf-8')
+
# create root widget
global_att = settings.get_theming_attribute('global', 'body')
mainframe = urwid.Frame(urwid.SolidFill())