diff --git a/src/fenrirscreenreader/screenDriver/ptyDriver.py b/src/fenrirscreenreader/screenDriver/ptyDriver.py index 7d2ea300..c90f4af7 100644 --- a/src/fenrirscreenreader/screenDriver/ptyDriver.py +++ b/src/fenrirscreenreader/screenDriver/ptyDriver.py @@ -130,7 +130,22 @@ class driver(screenDriver): if self.signalPipe[0] in r: os.read(self.signalPipe[0], 1) lines, columns = self.resizeTerminal(self.p_out) - terminal.resize(lines, columns) + terminal.resize(lines, columns) + # input + if sys.stdin in r: + if debug: + print('pre stdin') + try: + msgBytes = self.readAll(sys.stdin.fileno()) + eventQueue.put({"Type":fenrirEventType.ByteInput, + "Data":msgBytes + }) + except (EOFError, OSError): + active.value = False + break + #self.injectTextToScreen(msgBytes) + if debug: + print('after stdin') # output if self.p_out in r: if debug: @@ -150,22 +165,7 @@ class driver(screenDriver): "Data":screen_utils.createScreenEventData(terminal.dump()) }) if debug: - print('after p_out') - # input - if sys.stdin in r: - if debug: - print('pre stdin') - try: - msgBytes = self.readAll(sys.stdin.fileno()) - eventQueue.put({"Type":fenrirEventType.ByteInput, - "Data":msgBytes - }) - except (EOFError, OSError): - active.value = False - break - #self.injectTextToScreen(msgBytes) - if debug: - print('after stdin') + print('after p_out') except Exception as e: # Process died? print(e) active.value = False