refactor: add isClosed property to tracker

old-agentic-v1^2
Philipp Burckhardt 2023-07-05 13:59:07 -04:00
rodzic eef5f88c29
commit 419ba7347c
1 zmienionych plików z 9 dodań i 0 usunięć

Wyświetl plik

@ -34,6 +34,7 @@ export class TerminalTaskTracker {
protected _viewMode = 'tasks'
protected _outputs: Array<string | Uint8Array> = []
protected _renderingPaused = false
protected _isClosed = false
protected _spinnerInterval: number
protected _inactivityInterval: number
@ -120,9 +121,15 @@ export class TerminalTaskTracker {
process.stdin.on('keypress', this.handleKeyPress)
this.startInactivityTimeout()
this._isClosed = false
}
close() {
if (this._isClosed) {
return
}
if (this._interval) {
clearInterval(this._interval)
}
@ -160,6 +167,8 @@ export class TerminalTaskTracker {
// Pause the reading of stdin so that the Node.js process will exit once done:
process.stdin.pause()
this._isClosed = true
}
pause() {