@@ -56,9 +56,6 @@ import { GroupKind } from 'vs/workbench/contrib/tasks/common/taskConfiguration';
56
56
import { Codicon } from 'vs/base/common/codicons' ;
57
57
import { VSCodeOscProperty , VSCodeOscPt , VSCodeSequence } from 'vs/workbench/contrib/terminal/browser/terminalEscapeSequences' ;
58
58
59
- const taskShellIntegrationStartSequence = VSCodeSequence ( VSCodeOscPt . PromptStart ) + VSCodeSequence ( VSCodeOscPt . Property , `${ VSCodeOscProperty . Task } =True` ) + VSCodeSequence ( VSCodeOscPt . CommandStart ) ;
60
- const taskShellIntegrationOutputSequence = VSCodeSequence ( VSCodeOscPt . CommandExecuted ) ;
61
-
62
59
interface ITerminalData {
63
60
terminal : ITerminalInstance ;
64
61
lastTask : string ;
@@ -211,6 +208,13 @@ export class TerminalTaskSystem extends Disposable implements ITaskSystem {
211
208
212
209
private readonly _onDidStateChange : Emitter < ITaskEvent > ;
213
210
211
+ get taskShellIntegrationStartSequence ( ) : string {
212
+ return this . _configurationService . getValue ( 'task.showDecorations' ) ? VSCodeSequence ( VSCodeOscPt . PromptStart ) + VSCodeSequence ( VSCodeOscPt . Property , `${ VSCodeOscProperty . Task } =True` ) + VSCodeSequence ( VSCodeOscPt . CommandStart ) : '' ;
213
+ }
214
+ get taskShellIntegrationOutputSequence ( ) : string {
215
+ return this . _configurationService . getValue ( 'task.showDecorations' ) ? VSCodeSequence ( VSCodeOscPt . CommandExecuted ) : '' ;
216
+ }
217
+
214
218
constructor (
215
219
private _terminalService : ITerminalService ,
216
220
private _terminalGroupService : ITerminalGroupService ,
@@ -1132,18 +1136,18 @@ export class TerminalTaskSystem extends Disposable implements ITaskSystem {
1132
1136
shellLaunchConfig . args = windowsShellArgs ? combinedShellArgs . join ( ' ' ) : combinedShellArgs ;
1133
1137
if ( task . command . presentation && task . command . presentation . echo ) {
1134
1138
if ( needsFolderQualification && workspaceFolder ) {
1135
- shellLaunchConfig . initialText = taskShellIntegrationStartSequence + formatMessageForTerminal ( nls . localize ( {
1139
+ shellLaunchConfig . initialText = this . taskShellIntegrationStartSequence + formatMessageForTerminal ( nls . localize ( {
1136
1140
key : 'task.executingInFolder' ,
1137
1141
comment : [ 'The workspace folder the task is running in' , 'The task command line or label' ]
1138
- } , 'Executing task in folder {0}: {1}' , workspaceFolder . name , commandLine ) , { excludeLeadingNewLine : true } ) + taskShellIntegrationOutputSequence ;
1142
+ } , 'Executing task in folder {0}: {1}' , workspaceFolder . name , commandLine ) , { excludeLeadingNewLine : true } ) + this . taskShellIntegrationOutputSequence ;
1139
1143
} else {
1140
- shellLaunchConfig . initialText = taskShellIntegrationStartSequence + formatMessageForTerminal ( nls . localize ( {
1144
+ shellLaunchConfig . initialText = this . taskShellIntegrationStartSequence + formatMessageForTerminal ( nls . localize ( {
1141
1145
key : 'task.executing' ,
1142
1146
comment : [ 'The task command line or label' ]
1143
- } , 'Executing task: {0}' , commandLine ) , { excludeLeadingNewLine : true } ) + taskShellIntegrationOutputSequence ;
1147
+ } , 'Executing task: {0}' , commandLine ) , { excludeLeadingNewLine : true } ) + this . taskShellIntegrationOutputSequence ;
1144
1148
}
1145
1149
} else {
1146
- shellLaunchConfig . initialText = taskShellIntegrationStartSequence + taskShellIntegrationOutputSequence ;
1150
+ shellLaunchConfig . initialText = this . taskShellIntegrationStartSequence + this . taskShellIntegrationOutputSequence ;
1147
1151
}
1148
1152
} else {
1149
1153
const commandExecutable = ( task . command . runtime !== RuntimeType . CustomExecution ) ? CommandString . value ( command ) : undefined ;
@@ -1172,18 +1176,18 @@ export class TerminalTaskSystem extends Disposable implements ITaskSystem {
1172
1176
return args . join ( ' ' ) ;
1173
1177
} ;
1174
1178
if ( needsFolderQualification && workspaceFolder ) {
1175
- shellLaunchConfig . initialText = taskShellIntegrationStartSequence + formatMessageForTerminal ( nls . localize ( {
1179
+ shellLaunchConfig . initialText = this . taskShellIntegrationStartSequence + formatMessageForTerminal ( nls . localize ( {
1176
1180
key : 'task.executingInFolder' ,
1177
1181
comment : [ 'The workspace folder the task is running in' , 'The task command line or label' ]
1178
- } , 'Executing task in folder {0}: {1}' , workspaceFolder . name , `${ shellLaunchConfig . executable } ${ getArgsToEcho ( shellLaunchConfig . args ) } ` ) , { excludeLeadingNewLine : true } ) + taskShellIntegrationOutputSequence ;
1182
+ } , 'Executing task in folder {0}: {1}' , workspaceFolder . name , `${ shellLaunchConfig . executable } ${ getArgsToEcho ( shellLaunchConfig . args ) } ` ) , { excludeLeadingNewLine : true } ) + this . taskShellIntegrationOutputSequence ;
1179
1183
} else {
1180
- shellLaunchConfig . initialText = taskShellIntegrationStartSequence + formatMessageForTerminal ( nls . localize ( {
1184
+ shellLaunchConfig . initialText = this . taskShellIntegrationStartSequence + formatMessageForTerminal ( nls . localize ( {
1181
1185
key : 'task.executing' ,
1182
1186
comment : [ 'The task command line or label' ]
1183
- } , 'Executing task: {0}' , `${ shellLaunchConfig . executable } ${ getArgsToEcho ( shellLaunchConfig . args ) } ` ) , { excludeLeadingNewLine : true } ) + taskShellIntegrationOutputSequence ;
1187
+ } , 'Executing task: {0}' , `${ shellLaunchConfig . executable } ${ getArgsToEcho ( shellLaunchConfig . args ) } ` ) , { excludeLeadingNewLine : true } ) + this . taskShellIntegrationOutputSequence ;
1184
1188
}
1185
1189
} else {
1186
- shellLaunchConfig . initialText = taskShellIntegrationStartSequence + taskShellIntegrationOutputSequence ;
1190
+ shellLaunchConfig . initialText = this . taskShellIntegrationStartSequence + this . taskShellIntegrationOutputSequence ;
1187
1191
}
1188
1192
}
1189
1193
0 commit comments