@@ -198,7 +198,7 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
198
198
199
199
// PS1 in some cases is a shell variable (not an env variable) so "env" might not contain it, calculate it in that case.
200
200
env . PS1 = await this . getPS1 ( shell , resource , env ) ;
201
- const prependOptions = await this . getPrependOptions ( ) ;
201
+ const defaultPrependOptions = await this . getPrependOptions ( ) ;
202
202
203
203
// Clear any previously set env vars from collection
204
204
envVarCollection . clear ( ) ;
@@ -213,8 +213,12 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
213
213
if ( value !== undefined ) {
214
214
if ( key === 'PS1' ) {
215
215
// We cannot have the full PS1 without executing in terminal, which we do not. Hence prepend it.
216
- traceVerbose ( `Prepending environment variable ${ key } in collection with ${ value } ` ) ;
217
- envVarCollection . prepend ( key , value , prependOptions ) ;
216
+ traceVerbose (
217
+ `Prepending environment variable ${ key } in collection with ${ value } ${ JSON . stringify (
218
+ defaultPrependOptions ,
219
+ ) } `,
220
+ ) ;
221
+ envVarCollection . prepend ( key , value , defaultPrependOptions ) ;
218
222
return ;
219
223
}
220
224
if ( key === 'PATH' ) {
@@ -229,7 +233,11 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
229
233
if ( deactivate ) {
230
234
value = `${ deactivate } ${ this . separator } ${ value } ` ;
231
235
}
232
- traceVerbose ( `Prepending environment variable ${ key } in collection with ${ value } ` ) ;
236
+ traceVerbose (
237
+ `Prepending environment variable ${ key } in collection with ${ value } ${ JSON . stringify (
238
+ options ,
239
+ ) } `,
240
+ ) ;
233
241
envVarCollection . prepend ( key , value , options ) ;
234
242
} else {
235
243
if ( ! value . endsWith ( this . separator ) ) {
@@ -238,16 +246,23 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
238
246
if ( deactivate ) {
239
247
value = `${ deactivate } ${ this . separator } ${ value } ` ;
240
248
}
241
- traceVerbose ( `Prepending environment variable ${ key } in collection to ${ value } ` ) ;
249
+ traceVerbose (
250
+ `Prepending environment variable ${ key } in collection to ${ value } ${ JSON . stringify (
251
+ options ,
252
+ ) } `,
253
+ ) ;
242
254
envVarCollection . prepend ( key , value , options ) ;
243
255
}
244
256
return ;
245
257
}
246
- traceVerbose ( `Setting environment variable ${ key } in collection to ${ value } ` ) ;
247
- envVarCollection . replace ( key , value , {
258
+ const options = {
248
259
applyAtShellIntegration : true ,
249
260
applyAtProcessCreation : true ,
250
- } ) ;
261
+ } ;
262
+ traceVerbose (
263
+ `Setting environment variable ${ key } in collection to ${ value } ${ JSON . stringify ( options ) } ` ,
264
+ ) ;
265
+ envVarCollection . replace ( key , value , options ) ;
251
266
}
252
267
}
253
268
} ) ;
0 commit comments