* Replace char/hyperlink pools with fresh instances to prevent unbounded * growth during long sessions. Migrates the front frame's screen IDs into * the new pools so diffing remains correct. The back frame doesn't need * migration — resetScreen zeros it before any reads. * * Call betw
()
| 1559 | * Call between conversation turns or periodically. |
| 1560 | */ |
| 1561 | resetPools(): void { |
| 1562 | this.charPool = new CharPool(); |
| 1563 | this.hyperlinkPool = new HyperlinkPool(); |
| 1564 | migrateScreenPools(this.frontFrame.screen, this.charPool, this.hyperlinkPool); |
| 1565 | // Back frame's data is zeroed by resetScreen before reads, but its pool |
| 1566 | // references are used by the renderer to intern new characters. Point |
| 1567 | // them at the new pools so the next frame's IDs are comparable. |
| 1568 | this.backFrame.screen.charPool = this.charPool; |
| 1569 | this.backFrame.screen.hyperlinkPool = this.hyperlinkPool; |
| 1570 | } |
| 1571 | patchConsole(): () => void { |
| 1572 | // biome-ignore lint/suspicious/noConsole: intentionally patching global console |
| 1573 | const con = console; |
no test coverage detected