diff --git a/src/fenrir/core/screenData.py b/src/fenrir/core/screenData.py index 28c43bda..da6e771d 100644 --- a/src/fenrir/core/screenData.py +++ b/src/fenrir/core/screenData.py @@ -18,7 +18,7 @@ screenData = { 'oldContentText': '', 'oldContentAttrib': b'', 'oldApplication': '', -'oldTTY':'-1', +'oldTTY':None, 'newDelta': '', 'newNegativeDelta': '', 'newCursorReview':None, diff --git a/src/fenrir/core/screenManager.py b/src/fenrir/core/screenManager.py index de422355..9e2a0bd2 100644 --- a/src/fenrir/core/screenManager.py +++ b/src/fenrir/core/screenManager.py @@ -41,6 +41,8 @@ class screenManager(): (screen in self.autoIgnoreScreens)) def isScreenChange(self): + if not self.env['screenData']['oldTTY']: + return False return self.env['screenData']['newTTY'] != self.env['screenData']['oldTTY'] def getWindowAreaInText(self, text): @@ -57,13 +59,14 @@ class screenManager(): def changeBrailleScreen(self): if not self.env['runtime']['brailleDriver']: return - if not self.isSuspendingScreen(self.env['screenData']['oldTTY']): - try: - self.env['runtime']['brailleDriver'].leveScreen() - except Exception as e: - print(e) + if self.env['screenData']['oldTTY']: + if not self.isSuspendingScreen(self.env['screenData']['oldTTY']): + try: + self.env['runtime']['brailleDriver'].leveScreen() + except Exception as e: + pass if not self.isSuspendingScreen(): try: self.env['runtime']['brailleDriver'].enterScreen(self.env['screenData']['newTTY']) except Exception as e: - print(e) + pass