From 181c9bd2fef25c6f8b636fbb1c188741af9374fc Mon Sep 17 00:00:00 2001 From: chrys Date: Tue, 20 Aug 2019 12:00:39 +0200 Subject: [PATCH] Update ptyDriver.py --- src/fenrirscreenreader/screenDriver/ptyDriver.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fenrirscreenreader/screenDriver/ptyDriver.py b/src/fenrirscreenreader/screenDriver/ptyDriver.py index 522325f4..22727e64 100644 --- a/src/fenrirscreenreader/screenDriver/ptyDriver.py +++ b/src/fenrirscreenreader/screenDriver/ptyDriver.py @@ -197,11 +197,13 @@ class driver(screenDriver): except (EOFError, OSError): active.value = False break + # feed and send event bevore write, the pyte already has the right state + # so fenrir already can progress bevore os.write what should give some better reaction time self.terminal.feed(msgBytes) - os.write(sys.stdout.fileno(), msgBytes) eventQueue.put({"Type":fenrirEventType.ScreenUpdate, "Data":screen_utils.createScreenEventData(self.terminal.GetScreenContent()) }) + os.write(sys.stdout.fileno(), msgBytes) except Exception as e: # Process died? print(e) active.value = False