@@ -26,6 +26,7 @@ import { ITerminalCommand } from 'vs/workbench/contrib/terminal/common/terminal'
2626import { TERMINAL_COMMAND_DECORATION_DEFAULT_BACKGROUND_COLOR , TERMINAL_COMMAND_DECORATION_ERROR_BACKGROUND_COLOR , TERMINAL_COMMAND_DECORATION_SUCCESS_BACKGROUND_COLOR } from 'vs/workbench/contrib/terminal/common/terminalColorRegistry' ;
2727import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle' ;
2828import { IDecoration , ITerminalAddon , Terminal } from 'xterm' ;
29+ import { AudioCue , IAudioCueService } from 'vs/platform/audioCues/browser/audioCueService' ;
2930
3031interface IDisposableDecoration { decoration : IDecoration ; disposables : IDisposable [ ] ; exitCode ?: number ; markProperties ?: IMarkProperties }
3132
@@ -51,7 +52,8 @@ export class DecorationAddon extends Disposable implements ITerminalAddon {
5152 @IQuickInputService private readonly _quickInputService : IQuickInputService ,
5253 @ILifecycleService lifecycleService : ILifecycleService ,
5354 @ICommandService private readonly _commandService : ICommandService ,
54- @IInstantiationService instantiationService : IInstantiationService
55+ @IInstantiationService instantiationService : IInstantiationService ,
56+ @IAudioCueService private readonly _audioCueService : IAudioCueService
5557 ) {
5658 super ( ) ;
5759 this . _register ( toDisposable ( ( ) => this . _dispose ( ) ) ) ;
@@ -217,7 +219,12 @@ export class DecorationAddon extends Disposable implements ITerminalAddon {
217219 for ( const command of capability . commands ) {
218220 this . registerCommandDecoration ( command ) ;
219221 }
220- commandDetectionListeners . push ( capability . onCommandFinished ( command => this . registerCommandDecoration ( command ) ) ) ;
222+ commandDetectionListeners . push ( capability . onCommandFinished ( command => {
223+ this . registerCommandDecoration ( command ) ;
224+ if ( command . exitCode ) {
225+ this . _audioCueService . playAudioCue ( AudioCue . terminalCommandFailed ) ;
226+ }
227+ } ) ) ;
221228 // Command invalidated
222229 commandDetectionListeners . push ( capability . onCommandInvalidated ( commands => {
223230 for ( const command of commands ) {
0 commit comments