* 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'
()
| 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 |
no test coverage detected