diff --git a/packages/@ant/ink/src/core/ink.tsx b/packages/@ant/ink/src/core/ink.tsx index 37d3a91c7..60da7d94d 100644 --- a/packages/@ant/ink/src/core/ink.tsx +++ b/packages/@ant/ink/src/core/ink.tsx @@ -165,12 +165,6 @@ export default class Ink { private frontFrame: Frame; private backFrame: Frame; private lastPoolResetTime = performance.now(); - /** Timestamp of last periodic full-redraw in main screen mode. Used to - * recover from accumulated cursor drift / blit ghosting. Wall-clock - * based (not frame-count) so drain scroll frames (250fps) don't - * accelerate the cycle. Alt-screen doesn't need this — CSI H resets - * cursor every frame. */ - private lastMainScreenHealTime = performance.now(); private drainTimer: ReturnType | null = null; private lastYogaCounters: { ms: number; @@ -527,25 +521,7 @@ export default class Ink { // an extra React re-render cycle. this.options.onBeforeRender?.(); - // Periodic self-healing: every ~5s in main screen mode, force a full - // terminal redraw to recover from accumulated cursor drift / blit - // ghosting. Alt-screen doesn't need this — CSI H resets cursor to - // (0,0) every frame. Wall-clock based so drain scroll frames (250fps) - // don't accelerate the cycle. Guarded by isTTY so ANSI escape - // sequences are not leaked into pipes / redirected output. const renderStart = performance.now(); - if ( - !this.altScreenActive && - !this.isPaused && - this.options.stdout.isTTY && - renderStart - this.lastMainScreenHealTime > 5000 - ) { - this.lastMainScreenHealTime = renderStart; - this.repaint(); - this.prevFrameContaminated = true; - this.needsEraseBeforePaint = true; - } - const terminalWidth = this.options.stdout.columns || 80; const terminalRows = this.options.stdout.rows || 24; @@ -780,13 +756,6 @@ export default class Ink { optimized.unshift(CURSOR_HOME_PATCH); } optimized.push(this.altScreenParkPatch); - } else if (this.needsEraseBeforePaint && hasDiff) { - // Main-screen periodic self-healing: clear visible terminal before - // painting the diff. Without this, rows past the new frame's height - // would retain stale content from the previous frame. BSU/ESU keeps - // old content visible until the full erase+paint is flushed atomically. - this.needsEraseBeforePaint = false; - optimized.unshift(ERASE_THEN_HOME_PATCH); } // Native cursor positioning: park the terminal cursor at the declared