mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-12-23 04:31:56 +00:00
Implement pty recovery
This commit is contained in:
parent
555d571112
commit
e20a5dab23
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user