diff --git a/lib/progress.ts b/lib/progress.ts index 903e6a529cd2becee57fd11eeaaf52ab602e65a6..17a416158f7726880fa92421b12f3c4fa721b34d 100644 --- a/lib/progress.ts +++ b/lib/progress.ts @@ -704,12 +704,11 @@ function renderChildren(state: ReadOnlyNode, now: number, depth: boolean[]) { truncated += 1; continue; } - const logLines = child?.logs + const logLines = child.logs .map((msg) => log.formatMessage(msg, true)) .join("") - .split("\n") - .slice(-Math.min(3, maxHeight)) ?? []; - for (const line of logLines) { + .trim(); + if (logLines) for (const line of logLines.split("\n").slice(-Math.min(3, maxHeight))) { item += left + (i === length - 1 && !truncated ? " " : box.line) + " " + ansi.style(ansi.fgBrightBlack, ">") + " " + line + "\n";