Skip to content

Commit d902fb0

Browse files
committed
fix: cases when there are no shells reported
1 parent 8fa3a9e commit d902fb0

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

src/features/terminal/shellStartupSetupHandlers.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ export async function handleSettingUpShellProfile(
2323
callback: (provider: ShellStartupScriptProvider, result: boolean) => void,
2424
): Promise<void> {
2525
const providers = getProviders(shellTypes, allProviders);
26+
if (providers.length === 0) {
27+
traceVerbose('No shell providers found for the specified shell types: ' + Array.from(shellTypes).join(', '));
28+
}
2629
const shells = providers.map((p) => p.shellType).join(', ');
2730
const response = await showInformationMessage(
2831
l10n.t(

src/features/terminal/terminalManager.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,11 @@ export class TerminalManagerImpl implements TerminalManager {
112112
.map((t) => identifyTerminalShell(t))
113113
.filter((t) => t !== 'unknown'),
114114
);
115-
await handleSettingUpShellProfile(shells, this.startupScriptProviders, (p, v) =>
116-
this.shellSetup.set(p.shellType, v),
117-
);
115+
if (shells.size > 0) {
116+
await handleSettingUpShellProfile(shells, this.startupScriptProviders, (p, v) =>
117+
this.shellSetup.set(p.shellType, v),
118+
);
119+
}
118120
}
119121
}
120122
}),
@@ -319,9 +321,11 @@ export class TerminalManagerImpl implements TerminalManager {
319321
.map((t) => identifyTerminalShell(t))
320322
.filter((t) => t !== 'unknown'),
321323
);
322-
await handleSettingUpShellProfile(shells, this.startupScriptProviders, (p, v) =>
323-
this.shellSetup.set(p.shellType, v),
324-
);
324+
if (shells.size > 0) {
325+
await handleSettingUpShellProfile(shells, this.startupScriptProviders, (p, v) =>
326+
this.shellSetup.set(p.shellType, v),
327+
);
328+
}
325329
}
326330
}
327331

0 commit comments

Comments
 (0)