perf: trim terminal tail bursts with slice

Uses a single tail slice when retained terminal output exceeds the line cap.
This commit is contained in:
Neil
2026-05-30 13:11:56 -07:00
committed by GitHub
parent 28e2ce929f
commit bc11db4e9f
2 changed files with 23 additions and 4 deletions
+3 -3
View File
@@ -12686,7 +12686,7 @@ function buildTerminalWaitText(lines: string[], partialLine: string, preview: st
return waitText.length > 0 ? waitText : preview
}
function appendNormalizedToTailBuffer(
export function appendNormalizedToTailBuffer(
previousLines: string[],
previousPartialLine: string,
normalizedChunk: string
@@ -12719,8 +12719,8 @@ function appendNormalizedToTailBuffer(
: previousLines
let truncated = previousPartialWasCapped || nextPartialLine.length > MAX_TAIL_PARTIAL_CHARS
while (nextLines.length > MAX_TAIL_LINES) {
nextLines.shift()
if (nextLines.length > MAX_TAIL_LINES) {
nextLines = nextLines.slice(nextLines.length - MAX_TAIL_LINES)
truncated = true
}