Skip to content

Commit cb2128f

Browse files
committed
fix(live-proof): drain output after successful exit
1 parent 6396ea5 commit cb2128f

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

‎src/live-proof/drivers.ts‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,22 @@ function runTerminalCommand(
804804
const failure = terminalCommandFailure(command, exitStatus, capturedOutput);
805805
throw new TerminalCommandExecutionError(failure.message, window);
806806
}
807-
if (exitStatus === 0) return window;
807+
if (exitStatus === 0) {
808+
const settledStatus = observeTerminalCommandStatus(
809+
runner,
810+
checkout,
811+
terminalSession,
812+
window,
813+
readCommandStatus,
814+
TERMINAL_COMMAND_STATUS_GRACE_SECONDS,
815+
true,
816+
);
817+
if (settledStatus !== undefined && settledStatus !== 0) {
818+
const failure = terminalCommandFailure(command, settledStatus, window.output);
819+
throw new TerminalCommandExecutionError(failure.message, window);
820+
}
821+
return window;
822+
}
808823
if (capturedOutput.trim()) {
809824
// Output commonly precedes process exit; wait briefly for tmux to publish the
810825
// pane's final status before treating it as intentionally long-running.

0 commit comments

Comments
 (0)