@@ -36,20 +36,23 @@ export class MainThreadTerminalShellIntegration extends Disposable implements Ma
36
36
37
37
// onDidStartTerminalShellExecution
38
38
const commandDetectionStartEvent = this . _store . add ( this . _terminalService . createOnInstanceCapabilityEvent ( TerminalCapability . CommandDetection , e => e . onCommandExecuted ) ) ;
39
- let lastCommand : ITerminalCommand | undefined ;
39
+ let currentCommand : ITerminalCommand | undefined ;
40
40
this . _store . add ( commandDetectionStartEvent . event ( e => {
41
41
// Prevent duplicate events from being sent in case command detection double fires the
42
42
// event
43
- if ( e . data === lastCommand ) {
43
+ if ( e . data === currentCommand ) {
44
44
return ;
45
45
}
46
- lastCommand = e . data ;
46
+ currentCommand = e . data ;
47
47
this . _proxy . $shellExecutionStart ( e . instance . instanceId , e . data . command , e . data . cwd ) ;
48
48
} ) ) ;
49
49
50
50
// onDidEndTerminalShellExecution
51
51
const commandDetectionEndEvent = this . _store . add ( this . _terminalService . createOnInstanceCapabilityEvent ( TerminalCapability . CommandDetection , e => e . onCommandFinished ) ) ;
52
- this . _store . add ( commandDetectionEndEvent . event ( e => this . _proxy . $shellExecutionEnd ( e . instance . instanceId , e . data . command , e . data . exitCode ) ) ) ;
52
+ this . _store . add ( commandDetectionEndEvent . event ( e => {
53
+ currentCommand = undefined ;
54
+ this . _proxy . $shellExecutionEnd ( e . instance . instanceId , e . data . command , e . data . exitCode ) ;
55
+ } ) ) ;
53
56
54
57
// onDidChangeTerminalShellIntegration via cwd
55
58
const cwdChangeEvent = this . _store . add ( this . _terminalService . createOnInstanceCapabilityEvent ( TerminalCapability . CwdDetection , e => e . onDidChangeCwd ) ) ;
0 commit comments