diff --git a/extra/theme_test.py b/extra/theme_test.py old mode 100644 new mode 100755 index 6f38150cf..73f371559 --- a/extra/theme_test.py +++ b/extra/theme_test.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 """ Theme tester """ @@ -91,6 +92,11 @@ def get_text(t, colourmode): return txt +def input_handler(key: str) -> None: + "exit on any key press" + raise urwid.ExitMainLoop() + + def main(): """ Theme tester @@ -107,7 +113,7 @@ def main(): txt += get_text(t, colourmode) fill = urwid.Filler(urwid.Text(txt), "top") - loop = urwid.MainLoop(fill) + loop = urwid.MainLoop(fill, unhandled_input=input_handler) loop.run()