mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix(ui-tui): preserve composer after resize-burst healing
- run the xterm.js settle-heal pass through a full render commit instead of diff-only scheduleRender - guard against overlapping resize renders and clear settle timers on unmount
This commit is contained in:
parent
f7e86577bc
commit
3e01de0b09
1 changed files with 24 additions and 4 deletions
|
|
@ -467,13 +467,29 @@ export default class Ink {
|
|||
this.resizeSettleTimer = setTimeout(() => {
|
||||
this.resizeSettleTimer = null
|
||||
|
||||
if (this.isUnmounted || this.isPaused || !this.altScreenActive || !this.options.stdout.isTTY) {
|
||||
if (
|
||||
this.isUnmounted ||
|
||||
this.isPaused ||
|
||||
!this.altScreenActive ||
|
||||
!this.options.stdout.isTTY ||
|
||||
this.currentNode === null ||
|
||||
this.pendingResizeRender
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
this.resetFramesForAltScreen()
|
||||
this.needsEraseBeforePaint = true
|
||||
this.scheduleRender()
|
||||
this.pendingResizeRender = true
|
||||
queueMicrotask(() => {
|
||||
this.pendingResizeRender = false
|
||||
|
||||
if (this.isUnmounted || this.isPaused || !this.altScreenActive || !this.options.stdout.isTTY || this.currentNode === null) {
|
||||
return
|
||||
}
|
||||
|
||||
this.resetFramesForAltScreen()
|
||||
this.needsEraseBeforePaint = true
|
||||
this.render(this.currentNode)
|
||||
})
|
||||
}, 160)
|
||||
}
|
||||
}
|
||||
|
|
@ -1954,6 +1970,10 @@ export default class Ink {
|
|||
clearTimeout(this.drainTimer)
|
||||
this.drainTimer = null
|
||||
}
|
||||
if (this.resizeSettleTimer !== null) {
|
||||
clearTimeout(this.resizeSettleTimer)
|
||||
this.resizeSettleTimer = null
|
||||
}
|
||||
|
||||
reconciler.updateContainerSync(null, this.container, null, noop)
|
||||
reconciler.flushSyncWork()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue