File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ export async function bashTool(args: { command: string; timeout?: number }, cwd:
5656 reject ( err ) ;
5757 } ) ;
5858
59- child . on ( "close" , ( code ) => {
59+ child . on ( "close" , ( code , signal ) => {
6060 if ( timeoutHandle ) clearTimeout ( timeoutHandle ) ;
6161
6262 const fullOutput = Buffer . concat ( chunks ) . toString ( "utf-8" ) ;
@@ -78,7 +78,10 @@ export async function bashTool(args: { command: string; timeout?: number }, cwd:
7878 outputText += `\n\n[Showing lines ${ startLine } -${ endLine } of ${ truncation . totalLines } (${ formatSize ( MAX_BYTES ) } limit)]` ;
7979 }
8080
81- if ( code !== 0 && code !== null ) {
81+ if ( signal ) {
82+ outputText += `\n\nProcess was killed by ${ signal } ` ;
83+ reject ( new Error ( outputText ) ) ;
84+ } else if ( code !== 0 && code !== null ) {
8285 outputText += `\n\nCommand exited with code ${ code } ` ;
8386 reject ( new Error ( outputText ) ) ;
8487 } else {
You can’t perform that action at this time.
0 commit comments