src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts/getDefaultShellArgs
export async function getDefaultShellArgs(
	fetchSetting: (key: TerminalShellSetting | TerminalShellArgsSetting) => string | string[] | undefined,
	useAutomationShell: boolean,
	variableResolver: VariableResolver | undefined,
	logService: ILogService,
	platformOverride: Platform = platform,
): Promise<string | string[]> {
	if (useAutomationShell) {
		if (!!getShellSetting(fetchSetting, 'automationShell', platformOverride)) {
			return [];
		}
	}

	const platformKey = platformOverride === Platform.Windows ? 'windows' : platformOverride === Platform.Mac ? 'osx' : 'linux';
	let args = fetchSetting(<TerminalShellArgsSetting>`${TerminalSettingPrefix.ShellArgs}${platformKey}`);
	if (!args) {
		return [];
	}
	if (typeof args === 'string' && platformOverride === Platform.Windows) {
		return variableResolver ? await variableResolver(args) : args;
	}
	if (variableResolver) {
		const resolvedArgs: string[] = [];
		for (const arg of args) {
			try {
				resolvedArgs.push(await variableResolver(arg));
			} catch (e) {
				logService.error(`Could not resolve ${TerminalSettingPrefix.ShellArgs}${platformKey}`, e);
				resolvedArgs.push(arg);
			}
		}
		args = resolvedArgs;
	}
	return args;
}