MCPcopy
hub / github.com/codeaashu/claude-code / forceRedraw

Method forceRedraw

src/ink/ink.tsx:825–838  ·  view source on GitHub ↗

* Clear the physical terminal and force a full redraw. * * The traditional readline ctrl+l — clears the visible screen and * redraws the current content. Also the recovery path when the terminal * was cleared externally (macOS Cmd+K) and Ink's diff engine thinks * unchanged cells don'

()

Source from the content-addressed store, hash-verified

823 * unchanged cells don't need repainting. Scrollback is preserved.
824 */
825 forceRedraw(): void {
826 if (!this.options.stdout.isTTY || this.isUnmounted || this.isPaused) return;
827 this.options.stdout.write(ERASE_SCREEN + CURSOR_HOME);
828 if (this.altScreenActive) {
829 this.resetFramesForAltScreen();
830 } else {
831 this.repaint();
832 // repaint() resets frontFrame to 0×0. Without this flag the next
833 // frame's blit optimization copies from that empty screen and the
834 // diff sees no content. onRender resets the flag at frame end.
835 this.prevFrameContaminated = true;
836 }
837 this.onRender();
838 }
839
840 /**
841 * Mark the previous frame as untrustworthy for blit, forcing the next

Callers 1

GlobalKeybindingHandlersFunction · 0.80

Calls 4

repaintMethod · 0.95
onRenderMethod · 0.95
writeMethod · 0.45

Tested by

no test coverage detected