@@ -64,13 +64,37 @@ function renderShellResult(result: unknown): boolean {
6464 ? c.green("success")
6565 : c.red("error");
6666
67- const stdoutLines = r.stdout.trim() ? r.stdout.split("\n").length : 0;
68- const stderrLines = r.stderr.trim() ? r.stderr.split("\n").length : 0;
67+ const stdoutNormalized = r.stdout.replace(/[\r\n]+$/, "");
68+ const stderrNormalized = r.stderr.replace(/[\r\n]+$/, "");
69+ const stdoutLines = stdoutNormalized
70+ ? stdoutNormalized.split(/\r?\n/).length
71+ : 0;
72+ const stderrLines = stderrNormalized
73+ ? stderrNormalized.split(/\r?\n/).length
74+ : 0;
75+ const stdoutSingleLine =
76+ stdoutLines === 1 ? (stdoutNormalized.split(/\r?\n/)[0] ?? "") : null;
6977
7078 writeln(
7179 ` ${badge} ${c.dim(`exit ${r.exitCode} · stdout ${stdoutLines}L · stderr ${stderrLines}L`)}`,
7280 );
7381
82+ if (
83+ r.success &&
84+ !r.timedOut &&
85+ stderrLines === 0 &&
86+ stdoutSingleLine !== null
87+ ) {
88+ const compact =
89+ stdoutSingleLine.length > 100
90+ ? `${stdoutSingleLine.slice(0, 97)}…`
91+ : stdoutSingleLine;
92+ if (compact.length > 0) {
93+ writeln(` ${c.dim(`stdout: ${compact}`)}`);
94+ }
95+ return true;
96+ }
97+
7498 if (!r.success || r.timedOut) {
7599 writePreviewLines({
76100 label: "stderr",