File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
packages/core/src/codewhispererChat/controllers/chat Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -588,8 +588,20 @@ export class ChatController {
588588 // Execute the command in terminal
589589 terminal . sendText ( command )
590590
591- // Store the outLogFilePath text in lastTerminalOutput
592- this . lastTerminalOutput = outLogFilePath
591+ // Read the content from outLogFilePath and store it in lastTerminalOutput
592+ try {
593+ // Wait a moment for the command to complete and write to the file
594+ await new Promise ( ( resolve ) => setTimeout ( resolve , 500 ) )
595+
596+ if ( await fs . existsFile ( outLogFilePath ) ) {
597+ this . lastTerminalOutput = await fs . readFileText ( outLogFilePath )
598+ } else {
599+ this . lastTerminalOutput = 'Command executed, but no output was captured.'
600+ }
601+ } catch ( readErr ) {
602+ getLogger ( ) . error ( `Failed to read output log file: ${ readErr } ` )
603+ this . lastTerminalOutput = `Error reading command output: ${ readErr } `
604+ }
593605
594606 getLogger ( ) . info ( `Command executed: ${ command } ` )
595607 getLogger ( ) . info ( `Output saved to: ${ outLogFilePath } ` )
You can’t perform that action at this time.
0 commit comments