@@ -430,7 +430,6 @@ export class RunInTerminalTool extends Disposable implements IToolImpl {
430
430
431
431
outputMonitor = store . add ( this . _instantiationService . createInstance ( OutputMonitor , execution , undefined , invocation . context ! , token , command ) ) ;
432
432
await Event . toPromise ( outputMonitor . onDidFinishCommand ) ;
433
- const pollingResult = outputMonitor . pollingResult ;
434
433
435
434
if ( token . isCancellationRequested ) {
436
435
throw new CancellationError ( ) ;
@@ -498,6 +497,7 @@ export class RunInTerminalTool extends Disposable implements IToolImpl {
498
497
499
498
let outputLineCount = - 1 ;
500
499
let exitCode : number | undefined ;
500
+ let outputMonitor : OutputMonitor | undefined ;
501
501
try {
502
502
let strategy : ITerminalExecuteStrategy ;
503
503
const commandDetection = toolTerminal . instance . capabilities . get ( TerminalCapability . CommandDetection ) ;
@@ -517,7 +517,11 @@ export class RunInTerminalTool extends Disposable implements IToolImpl {
517
517
}
518
518
}
519
519
this . _logService . debug ( `RunInTerminalTool: Using \`${ strategy . type } \` execute strategy for command \`${ command } \`` ) ;
520
+
521
+ outputMonitor = store . add ( this . _instantiationService . createInstance ( OutputMonitor , { instance : toolTerminal . instance , sessionId : invocation . context ! . sessionId , getOutput : ( ) => getOutput ( toolTerminal . instance ) } , undefined , invocation . context ! , token , command ) ) ;
520
522
const executeResult = await strategy . execute ( command , token ) ;
523
+ await Event . toPromise ( outputMonitor . onDidFinishCommand ) ;
524
+
521
525
if ( token . isCancellationRequested ) {
522
526
throw new CancellationError ( ) ;
523
527
}
@@ -560,9 +564,9 @@ export class RunInTerminalTool extends Disposable implements IToolImpl {
560
564
inputUserSigint,
561
565
terminalExecutionIdleBeforeTimeout : undefined ,
562
566
pollDurationMs : undefined ,
563
- inputToolManualAcceptCount : 0 ,
564
- inputToolManualRejectCount : 0 ,
565
- inputToolManualChars : 0 ,
567
+ inputToolManualAcceptCount : outputMonitor ?. outputMonitorTelemetryCounters ?. inputToolManualAcceptCount ,
568
+ inputToolManualRejectCount : outputMonitor ?. outputMonitorTelemetryCounters ?. inputToolManualRejectCount ,
569
+ inputToolManualChars : outputMonitor ?. outputMonitorTelemetryCounters ?. inputToolManualChars ,
566
570
} ) ;
567
571
}
568
572
0 commit comments