Implement pty recovery

This commit is contained in:
Kristóf Tóth 2018-03-06 14:33:01 +01:00
parent 555d571112
commit e20a5dab23

View File

@ -13,7 +13,8 @@ class TerminadoEventHandler(TriggerlessEventHandler):
self._historymonitor = HistoryMonitor(tfwenv.HISTFILE)
self.terminado_server = TerminadoMiniServer('/terminal', tfwenv.TERMINADO_PORT, tfwenv.TERMINADO_WD, ['bash'])
self.commands = {'write': self.write,
'read': self.read}
'read': self.read,
'resetshell': self.resetshell}
self._historymonitor.watch()
self.terminado_server.listen()
@ -35,5 +36,9 @@ class TerminadoEventHandler(TriggerlessEventHandler):
data['history'] = self.historymonitor.history[-data['count']:]
return data
def resetshell(self, data):
self.terminado_server.term_manager.terminal = None
self.terminado_server.term_manager.get_terminal()
def cleanup(self):
self.historymonitor.stop()