improve intial PTY emulation

This commit is contained in:
chrys 2018-03-24 02:11:55 +01:00
parent cbe51364fb
commit 8a4f2ac194
2 changed files with 4 additions and 8 deletions

View File

@ -56,11 +56,9 @@ class screenManager():
self.env['screen']['newCursor']['x'] = int( eventData['textCursor']['x']) self.env['screen']['newCursor']['x'] = int( eventData['textCursor']['x'])
self.env['screen']['newCursor']['y'] = int( eventData['textCursor']['y']) self.env['screen']['newCursor']['y'] = int( eventData['textCursor']['y'])
self.env['screen']['newTTY'] = eventData['screen'] self.env['screen']['newTTY'] = eventData['screen']
# analyze content
#self.updateCharMap(str(self.env['screen']['newTTY']))
self.env['screen']['newContentText'] = eventData['text'] self.env['screen']['newContentText'] = eventData['text']
self.env['screen']['newContentAttrib'] = eventData['attributes'] self.env['screen']['newContentAttrib'] = eventData['attributes']
# screen change
if self.env['screen']['newTTY'] != self.env['screen']['oldTTY']: if self.env['screen']['newTTY'] != self.env['screen']['oldTTY']:
self.env['screen']['oldContentBytes'] = b'' self.env['screen']['oldContentBytes'] = b''
self.env['screen']['oldContentAttrib'] = None self.env['screen']['oldContentAttrib'] = None

View File

@ -98,7 +98,7 @@ class driver(screenDriver):
running = False running = False
break break
if debug: if debug:
print('after p_out read') print('after p_out read',msgBytes)
terminal.feed(msgBytes) terminal.feed(msgBytes)
os.write(sys.stdout.fileno(), msgBytes) os.write(sys.stdout.fileno(), msgBytes)
if debug: if debug:
@ -106,8 +106,6 @@ class driver(screenDriver):
eventQueue.put({"Type":fenrirEventType.ScreenUpdate, eventQueue.put({"Type":fenrirEventType.ScreenUpdate,
"Data":self.createScreenEventData(terminal.dump()) "Data":self.createScreenEventData(terminal.dump())
}) })
#print(terminal.dump())
#self.createScreenEventData(terminal.dump())
if debug: if debug:
print('after p_out') print('after p_out')
# input # input
@ -143,7 +141,7 @@ class driver(screenDriver):
'x': int( content['cursor'][0]), 'x': int( content['cursor'][0]),
'y': int( content['cursor'][1]) 'y': int( content['cursor'][1])
}, },
'screen': 1, 'screen': '1',
'text': '', 'text': '',
'attributes': None, 'attributes': None,
'screenUpdateTime': time.time(), 'screenUpdateTime': time.time(),
@ -154,7 +152,7 @@ class driver(screenDriver):
for line in content['lines']: for line in content['lines']:
for e in line: for e in line:
eventData['text'] += ''.join(e[0]) eventData['text'] += ''.join(e[0])
#print(eventData['text']) print(eventData['text'])
#eventData['text'] = '' #eventData['text'] = ''
return eventData.copy() return eventData.copy()