@@ -26,6 +26,7 @@ import { TERMINAL_COMMAND_DECORATION_DEFAULT_BACKGROUND_COLOR, TERMINAL_COMMAND_
26
26
import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle' ;
27
27
import { IDecoration , ITerminalAddon , Terminal } from 'xterm' ;
28
28
import { AudioCue , IAudioCueService } from 'vs/platform/audioCues/browser/audioCueService' ;
29
+ import { INotificationService , Severity } from 'vs/platform/notification/common/notification' ;
29
30
30
31
interface IDisposableDecoration { decoration : IDecoration ; disposables : IDisposable [ ] ; exitCode ?: number ; markProperties ?: IMarkProperties }
31
32
@@ -52,7 +53,8 @@ export class DecorationAddon extends Disposable implements ITerminalAddon {
52
53
@ILifecycleService lifecycleService : ILifecycleService ,
53
54
@ICommandService private readonly _commandService : ICommandService ,
54
55
@IInstantiationService instantiationService : IInstantiationService ,
55
- @IAudioCueService private readonly _audioCueService : IAudioCueService
56
+ @IAudioCueService private readonly _audioCueService : IAudioCueService ,
57
+ @INotificationService private readonly _notificationService : INotificationService
56
58
) {
57
59
super ( ) ;
58
60
this . _register ( toDisposable ( ( ) => this . _dispose ( ) ) ) ;
@@ -349,7 +351,15 @@ export class DecorationAddon extends Disposable implements ITerminalAddon {
349
351
const labelRun = localize ( "terminal.rerunCommand" , 'Rerun Command' ) ;
350
352
actions . push ( {
351
353
class : undefined , tooltip : labelRun , id : 'terminal.rerunCommand' , label : labelRun , enabled : true ,
352
- run : ( ) => this . _onDidRequestRunCommand . fire ( { command } )
354
+ run : async ( ) => {
355
+ this . _notificationService . prompt ( Severity . Info , localize ( 'rerun' , 'Do you want to run the command: {0}' , command . command ) , [ {
356
+ label : localize ( 'yes' , 'Yes' ) ,
357
+ run : ( ) => this . _onDidRequestRunCommand . fire ( { command } )
358
+ } , {
359
+ label : localize ( 'no' , 'No' ) ,
360
+ run : ( ) => { }
361
+ } ] ) ;
362
+ }
353
363
} ) ;
354
364
const labelCopy = localize ( "terminal.copyCommand" , 'Copy Command' ) ;
355
365
actions . push ( {
0 commit comments