mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 19:31:33 +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._historymonitor = HistoryMonitor(tfwenv.HISTFILE)
|
||||||
self.terminado_server = TerminadoMiniServer('/terminal', tfwenv.TERMINADO_PORT, tfwenv.TERMINADO_WD, ['bash'])
|
self.terminado_server = TerminadoMiniServer('/terminal', tfwenv.TERMINADO_PORT, tfwenv.TERMINADO_WD, ['bash'])
|
||||||
self.commands = {'write': self.write,
|
self.commands = {'write': self.write,
|
||||||
'read': self.read}
|
'read': self.read,
|
||||||
|
'resetshell': self.resetshell}
|
||||||
self._historymonitor.watch()
|
self._historymonitor.watch()
|
||||||
self.terminado_server.listen()
|
self.terminado_server.listen()
|
||||||
|
|
||||||
@ -35,5 +36,9 @@ class TerminadoEventHandler(TriggerlessEventHandler):
|
|||||||
data['history'] = self.historymonitor.history[-data['count']:]
|
data['history'] = self.historymonitor.history[-data['count']:]
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
def resetshell(self, data):
|
||||||
|
self.terminado_server.term_manager.terminal = None
|
||||||
|
self.terminado_server.term_manager.get_terminal()
|
||||||
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
self.historymonitor.stop()
|
self.historymonitor.stop()
|
||||||
|
Loading…
Reference in New Issue
Block a user