src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts/resolveConfigurationVariables
function resolveConfigurationVariables(variableResolver: VariableResolver, env: ITerminalEnvironment): ITerminalEnvironment {
	Object.keys(env).forEach((key) => {
		const value = env[key];
		if (typeof value === 'string') {
			try {
				env[key] = variableResolver(value);
			} catch (e) {
				env[key] = value;
			}
		}
	});
	return env;
}