(force = false)
| 720 | } |
| 721 | |
| 722 | requestRender(force = false): void { |
| 723 | if (force) { |
| 724 | this.previousLines = []; |
| 725 | this.previousWidth = -1; // -1 triggers widthChanged, forcing a full clear |
| 726 | this.previousHeight = -1; // -1 triggers heightChanged, forcing a full clear |
| 727 | this.cursorRow = 0; |
| 728 | this.hardwareCursorRow = 0; |
| 729 | this.maxLinesRendered = 0; |
| 730 | this.previousViewportTop = 0; |
| 731 | if (this.renderTimer) { |
| 732 | clearTimeout(this.renderTimer); |
| 733 | this.renderTimer = undefined; |
| 734 | } |
| 735 | this.renderRequested = true; |
| 736 | process.nextTick(() => { |
| 737 | if (this.stopped || !this.renderRequested) { |
| 738 | return; |
| 739 | } |
| 740 | this.renderRequested = false; |
| 741 | this.lastRenderAt = performance.now(); |
| 742 | this.doRender(); |
| 743 | }); |
| 744 | return; |
| 745 | } |
| 746 | if (this.renderRequested) return; |
| 747 | this.renderRequested = true; |
| 748 | process.nextTick(() => this.scheduleRender()); |
| 749 | } |
| 750 | |
| 751 | private scheduleRender(): void { |
| 752 | if (this.stopped || this.renderTimer || !this.renderRequested) { |
no test coverage detected