fix(tui): replace spread-into-push in Container.render() to prevent stack overflow, closes #2651

This commit is contained in:
Mario Zechner
2026-04-09 03:32:59 +02:00
parent 4f7fc9de7e
commit 3b7448d156
2 changed files with 8 additions and 1 deletions

View File

@@ -2,6 +2,10 @@
## [Unreleased]
### Fixed
- Fixed `Container.render()` stack overflow on long sessions by replacing `Array.push(...spread)` with a loop-based push, preventing `RangeError: Maximum call stack size exceeded` when child output exceeds the V8 call stack argument limit ([#2651](https://github.com/badlogic/pi-mono/issues/2651))
## [0.66.1] - 2026-04-08
## [0.66.0] - 2026-04-08

View File

@@ -202,7 +202,10 @@ export class Container implements Component {
render(width: number): string[] {
const lines: string[] = [];
for (const child of this.children) {
lines.push(...child.render(width));
const childLines = child.render(width);
for (const line of childLines) {
lines.push(line);
}
}
return lines;
}