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:
Brooklyn Nicholson 2026-04-23 12:40:39 -05:00
parent f7e86577bc
commit 3e01de0b09

View file

@ -467,13 +467,29 @@ export default class Ink {
this.resizeSettleTimer = setTimeout(() => { this.resizeSettleTimer = setTimeout(() => {
this.resizeSettleTimer = null 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 return
} }
this.resetFramesForAltScreen() this.pendingResizeRender = true
this.needsEraseBeforePaint = true queueMicrotask(() => {
this.scheduleRender() 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) }, 160)
} }
} }
@ -1954,6 +1970,10 @@ export default class Ink {
clearTimeout(this.drainTimer) clearTimeout(this.drainTimer)
this.drainTimer = null this.drainTimer = null
} }
if (this.resizeSettleTimer !== null) {
clearTimeout(this.resizeSettleTimer)
this.resizeSettleTimer = null
}
reconciler.updateContainerSync(null, this.container, null, noop) reconciler.updateContainerSync(null, this.container, null, noop)
reconciler.flushSyncWork() reconciler.flushSyncWork()