[core/input] More robust event reading

Regular i3bar events *can* contain the character [, so a better
mechanism for detecting the initial opening [ is required. For now, do a
minimal change that requires the line to *start* with [. This should
never be the case for i3bar events, which are always JSON objects.

fixes #318
This commit is contained in:
Tobias Witek 2018-11-06 17:51:48 +01:00
parent 7a12a07a7c
commit 3e39f443ef

View file

@ -34,7 +34,7 @@ def read_input(inp):
continue
for fileno, event in events:
line = "["
while "[" in line:
while line.startswith("["):
line = sys.stdin.readline().strip(",").strip()
inp.has_event = True
try: