Skip to content

Commit 8b8c4fd

Browse files
author
Eric Wheeler
committed
fix: handle undefined exit codes in terminal output
When a terminal command completes with an undefined exit code: - Add explicit handling for undefined exit code case - Include clear message in output that exit code is undefined - Notify user to help diagnose potential terminal issues This helps identify and debug cases where the terminal process completes but the exit code is not properly captured. Signed-off-by: Eric Wheeler <[email protected]>
1 parent 4e0f868 commit 8b8c4fd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/core/Cline.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,14 +1023,16 @@ export class Cline {
10231023
if (exitDetails.coreDumpPossible) {
10241024
exitStatus += " - core dump possible"
10251025
}
1026+
} else if (exitDetails.exitCode === undefined) {
1027+
result += "<VSCE exit code is undefined: terminal output and command execution status is unknown.>"
1028+
exitStatus = `Exit code: <undefined, notify user>`
10261029
} else {
10271030
exitStatus = `Exit code: ${exitDetails.exitCode}`
10281031
}
10291032
}
10301033
const workingDirInfo = workingDir ? ` from '${workingDir.toPosix()}'` : ""
10311034

10321035
const outputInfo = `\nOutput:\n${result}`
1033-
10341036
return [
10351037
false,
10361038
`Command executed in terminal ${terminalInfo.id}${workingDirInfo}. ${exitStatus}${outputInfo}`,

0 commit comments

Comments
 (0)