From 89ca1b69b073c91e6f713005e81df6cdff3e5352 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 19 Jan 2026 14:45:40 +0000 Subject: [PATCH 1/4] Initial plan From fe94a02b618e1622fecba9d325613bc348079d41 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 19 Jan 2026 14:50:18 +0000 Subject: [PATCH 2/4] Fix activation command ANSI output by showing summary on success Co-authored-by: mtharrison <916064+mtharrison@users.noreply.github.com> --- src/extension.ts | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index fb2ba32..ba6a2a0 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -89,7 +89,6 @@ export function activate(context: vscode.ExtensionContext): void { "hapi/lab Test Runner" ); context.subscriptions.push(outputChannel); - outputChannel.show(true); const binPath = path.join(folder.uri.fsPath, "node_modules", ".bin"); const env = { @@ -97,7 +96,10 @@ export function activate(context: vscode.ExtensionContext): void { PATH: `${binPath}:${process.env.PATH}`, }; - outputChannel.appendLine(`> ${activationCommand}\n`); + // Buffer output to show only on failure + let stdoutBuffer = ""; + let stderrBuffer = ""; + let hasError = false; const proc = spawn(activationCommand, [], { cwd: folder.uri.fsPath, @@ -106,21 +108,48 @@ export function activate(context: vscode.ExtensionContext): void { }); proc.stdout.on("data", (data: Buffer) => { - outputChannel?.append(data.toString()); + stdoutBuffer += data.toString(); }); proc.stderr.on("data", (data: Buffer) => { - outputChannel?.append(data.toString()); + stderrBuffer += data.toString(); }); proc.on("error", (err) => { + hasError = true; + outputChannel?.show(true); + outputChannel?.appendLine(`> ${activationCommand}\n`); + if (stdoutBuffer) { + outputChannel?.append(stdoutBuffer); + } + if (stderrBuffer) { + outputChannel?.append(stderrBuffer); + } outputChannel?.appendLine( `\nActivation command failed: ${err.message}` ); }); proc.on("close", (code) => { - outputChannel?.appendLine(`\nProcess exited with code ${code}`); + if (code !== 0 || hasError) { + // Show full output on failure + if (!hasError) { + outputChannel?.show(true); + outputChannel?.appendLine(`> ${activationCommand}\n`); + if (stdoutBuffer) { + outputChannel?.append(stdoutBuffer); + } + if (stderrBuffer) { + outputChannel?.append(stderrBuffer); + } + } + outputChannel?.appendLine(`\nProcess exited with code ${code}`); + } else { + // Show success summary only + outputChannel?.appendLine( + `Activation command completed successfully` + ); + } }); } } From ff8fb30d1109e582eb0e57d777e02dfa10c44394 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 19 Jan 2026 14:52:13 +0000 Subject: [PATCH 3/4] Address code review feedback: extract helper and improve readability Co-authored-by: mtharrison <916064+mtharrison@users.noreply.github.com> --- src/extension.ts | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index ba6a2a0..7583014 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -101,6 +101,17 @@ export function activate(context: vscode.ExtensionContext): void { let stderrBuffer = ""; let hasError = false; + const showFailureOutput = () => { + outputChannel?.show(true); + outputChannel?.appendLine(`> ${activationCommand}\n`); + if (stdoutBuffer) { + outputChannel?.append(stdoutBuffer); + } + if (stderrBuffer) { + outputChannel?.append(stderrBuffer); + } + }; + const proc = spawn(activationCommand, [], { cwd: folder.uri.fsPath, env, @@ -117,38 +128,24 @@ export function activate(context: vscode.ExtensionContext): void { proc.on("error", (err) => { hasError = true; - outputChannel?.show(true); - outputChannel?.appendLine(`> ${activationCommand}\n`); - if (stdoutBuffer) { - outputChannel?.append(stdoutBuffer); - } - if (stderrBuffer) { - outputChannel?.append(stderrBuffer); - } + showFailureOutput(); outputChannel?.appendLine( `\nActivation command failed: ${err.message}` ); }); proc.on("close", (code) => { - if (code !== 0 || hasError) { - // Show full output on failure - if (!hasError) { - outputChannel?.show(true); - outputChannel?.appendLine(`> ${activationCommand}\n`); - if (stdoutBuffer) { - outputChannel?.append(stdoutBuffer); - } - if (stderrBuffer) { - outputChannel?.append(stderrBuffer); - } - } - outputChannel?.appendLine(`\nProcess exited with code ${code}`); - } else { + if (code === 0 && !hasError) { // Show success summary only outputChannel?.appendLine( `Activation command completed successfully` ); + } else { + // Show full output on failure + if (!hasError) { + showFailureOutput(); + } + outputChannel?.appendLine(`\nProcess exited with code ${code}`); } }); } From 93035c63c24b314b94e4a6b9c78ea451c373067c Mon Sep 17 00:00:00 2001 From: Matt Harrison Date: Mon, 19 Jan 2026 15:11:44 +0000 Subject: [PATCH 4/4] bug: trigger release for ANSI codes rendering fix Co-Authored-By: Claude Opus 4.5