Skip to content

Commit e4995f7

Browse files
committed
add more debugging tracelogs
1 parent 181193f commit e4995f7

File tree

1 file changed

+10
-1
lines changed
  • src/client/terminals/envCollectionActivation

1 file changed

+10
-1
lines changed

src/client/terminals/envCollectionActivation/service.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
174174

175175
private async _applyCollectionImpl(resource: Resource, shell = this.applicationEnvironment.shell): Promise<void> {
176176
const workspaceFolder = this.getWorkspaceFolder(resource);
177+
traceLog(`Inside _applyCollectionImpl in service.ts, workspace folder is: ${workspaceFolder}`);
177178
const settings = this.configurationService.getSettings(resource);
178179
const envVarCollection = this.getEnvironmentVariableCollection({ workspaceFolder });
179180
if (useEnvExtension()) {
@@ -317,13 +318,17 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
317318
private terminalPromptIsUnknown(resource: Resource) {
318319
const key = this.getWorkspaceFolder(resource)?.index;
319320
this.isPromptSet.delete(key);
321+
traceLog(`Inside terminalPromptIsUnknown in service.ts: this.PromptSet.delete: ${key}\n`);
320322
}
321323

322324
/**
323325
* Tracks whether prompt for terminal was correctly set.
324326
*/
325327
private async trackTerminalPrompt(shell: string, resource: Resource, env: EnvironmentVariables | undefined) {
326328
this.terminalPromptIsUnknown(resource);
329+
traceLog(
330+
`Inside trackTerminalPrompt in service.ts: just called terminalPromptIsUnknown with resource: ${resource}\n`,
331+
);
327332
if (!env) {
328333
this.terminalPromptIsCorrect(resource);
329334
return;
@@ -338,11 +343,12 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
338343
const shouldSetPS1 = shouldPS1BeSet(interpreter?.type, env);
339344
if (shouldSetPS1 && !env.PS1) {
340345
// PS1 should be set but no PS1 was set.
346+
traceVerbose('service.ts if (shouldSetPS1 && !env.PS1) condition \n');
341347
return;
342348
}
343349
const config = await this.shellIntegrationDetectionService.isWorking();
344350
if (!config) {
345-
traceVerbose('PS1 is not set when shell integration is disabled.');
351+
traceVerbose('PS1 is not set when shell integration is disabled.\n');
346352
return;
347353
}
348354
}
@@ -353,7 +359,9 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
353359
// PS1 returned by shell is not predictable: #22078
354360
// Hence calculate it ourselves where possible. Should no longer be needed once #22128 is available.
355361
const customShellType = identifyShellFromShellPath(shell);
362+
traceLog(`Inside getPS1 in service.ts: Custom shell type is ${customShellType}`);
356363
if (this.noPromptVariableShells.includes(customShellType)) {
364+
traceLog(`Inside getPS1 in service.ts: No prompt variable shells\n`);
357365
return env.PS1;
358366
}
359367
if (this.platform.osType !== OSType.Windows) {
@@ -369,6 +377,7 @@ export class TerminalEnvVarCollectionService implements IExtensionActivationServ
369377
}
370378
if (env.PS1) {
371379
// Prefer PS1 set by env vars, as env.PS1 may or may not contain the full PS1: #22056.
380+
traceLog(`Inside getPS1 in service.ts: Returning PS1 from env vars`);
372381
return env.PS1;
373382
}
374383
return undefined;

0 commit comments

Comments
 (0)