@@ -26,6 +26,7 @@ import { TERMINAL_COMMAND_DECORATION_DEFAULT_BACKGROUND_COLOR, TERMINAL_COMMAND_
2626import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle' ;
2727import { IDecoration , ITerminalAddon , Terminal } from 'xterm' ;
2828import { AudioCue , IAudioCueService } from 'vs/platform/audioCues/browser/audioCueService' ;
29+ import { INotificationService , Severity } from 'vs/platform/notification/common/notification' ;
2930
3031interface IDisposableDecoration { decoration : IDecoration ; disposables : IDisposable [ ] ; exitCode ?: number ; markProperties ?: IMarkProperties }
3132
@@ -52,7 +53,8 @@ export class DecorationAddon extends Disposable implements ITerminalAddon {
5253 @ILifecycleService lifecycleService : ILifecycleService ,
5354 @ICommandService private readonly _commandService : ICommandService ,
5455 @IInstantiationService instantiationService : IInstantiationService ,
55- @IAudioCueService private readonly _audioCueService : IAudioCueService
56+ @IAudioCueService private readonly _audioCueService : IAudioCueService ,
57+ @INotificationService private readonly _notificationService : INotificationService
5658 ) {
5759 super ( ) ;
5860 this . _register ( toDisposable ( ( ) => this . _dispose ( ) ) ) ;
@@ -349,7 +351,15 @@ export class DecorationAddon extends Disposable implements ITerminalAddon {
349351 const labelRun = localize ( "terminal.rerunCommand" , 'Rerun Command' ) ;
350352 actions . push ( {
351353 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+ }
353363 } ) ;
354364 const labelCopy = localize ( "terminal.copyCommand" , 'Copy Command' ) ;
355365 actions . push ( {
0 commit comments