未验证 提交 20388b6d 编写于 作者: A Andrii Dieiev 提交者: GitHub

Fix keys used to resolve terminal settings (#132851)

上级 99a72527
...@@ -209,7 +209,7 @@ export abstract class BaseTerminalProfileResolverService implements ITerminalPro ...@@ -209,7 +209,7 @@ export abstract class BaseTerminalProfileResolverService implements ITerminalPro
} }
private _getUnresolvedRealDefaultProfile(os: OperatingSystem): ITerminalProfile | undefined { private _getUnresolvedRealDefaultProfile(os: OperatingSystem): ITerminalProfile | undefined {
const defaultProfileName = this._configurationService.getValue(`${TerminalSettingPrefix.DefaultProfile}.${this._getOsKey(os)}`); const defaultProfileName = this._configurationService.getValue(`${TerminalSettingPrefix.DefaultProfile}${this._getOsKey(os)}`);
if (defaultProfileName && typeof defaultProfileName === 'string') { if (defaultProfileName && typeof defaultProfileName === 'string') {
return this._terminalService.availableProfiles.find(e => e.profileName === defaultProfileName); return this._terminalService.availableProfiles.find(e => e.profileName === defaultProfileName);
} }
...@@ -217,9 +217,9 @@ export abstract class BaseTerminalProfileResolverService implements ITerminalPro ...@@ -217,9 +217,9 @@ export abstract class BaseTerminalProfileResolverService implements ITerminalPro
} }
private async _getUnresolvedShellSettingDefaultProfile(options: IShellLaunchConfigResolveOptions): Promise<ITerminalProfile | undefined> { private async _getUnresolvedShellSettingDefaultProfile(options: IShellLaunchConfigResolveOptions): Promise<ITerminalProfile | undefined> {
let executable = this._configurationService.getValue<string>(`${TerminalSettingPrefix.Shell}.${this._getOsKey(options.os)}`); let executable = this._configurationService.getValue<string>(`${TerminalSettingPrefix.Shell}${this._getOsKey(options.os)}`);
if (!this._isValidShell(executable)) { if (!this._isValidShell(executable)) {
const shellArgs = this._configurationService.inspect(`${TerminalSettingPrefix.ShellArgs}.${this._getOsKey(options.os)}`); const shellArgs = this._configurationService.inspect(`${TerminalSettingPrefix.ShellArgs}${this._getOsKey(options.os)}`);
// && !this.getSafeConfigValue('shellArgs', options.os, false)) { // && !this.getSafeConfigValue('shellArgs', options.os, false)) {
if (!shellArgs.userValue && !shellArgs.workspaceValue) { if (!shellArgs.userValue && !shellArgs.workspaceValue) {
return undefined; return undefined;
...@@ -231,7 +231,7 @@ export abstract class BaseTerminalProfileResolverService implements ITerminalPro ...@@ -231,7 +231,7 @@ export abstract class BaseTerminalProfileResolverService implements ITerminalPro
} }
let args: string | string[] | undefined; let args: string | string[] | undefined;
const shellArgsSetting = this._configurationService.getValue(`${TerminalSettingPrefix.ShellArgs}.${this._getOsKey(options.os)}`); const shellArgsSetting = this._configurationService.getValue(`${TerminalSettingPrefix.ShellArgs}${this._getOsKey(options.os)}`);
if (this._isValidShellArgs(shellArgsSetting, options.os)) { if (this._isValidShellArgs(shellArgsSetting, options.os)) {
args = shellArgsSetting; args = shellArgsSetting;
} }
......
...@@ -326,7 +326,7 @@ export function getDefaultShellArgs( ...@@ -326,7 +326,7 @@ export function getDefaultShellArgs(
} }
const platformKey = platformOverride === Platform.Windows ? 'windows' : platformOverride === Platform.Mac ? 'osx' : 'linux'; const platformKey = platformOverride === Platform.Windows ? 'windows' : platformOverride === Platform.Mac ? 'osx' : 'linux';
let args = fetchSetting(<TerminalShellArgsSetting>`${TerminalSettingPrefix.ShellArgs}.${platformKey}`); let args = fetchSetting(<TerminalShellArgsSetting>`${TerminalSettingPrefix.ShellArgs}${platformKey}`);
if (!args) { if (!args) {
return []; return [];
} }
...@@ -339,7 +339,7 @@ export function getDefaultShellArgs( ...@@ -339,7 +339,7 @@ export function getDefaultShellArgs(
try { try {
resolvedArgs.push(variableResolver(arg)); resolvedArgs.push(variableResolver(arg));
} catch (e) { } catch (e) {
logService.error(`Could not resolve ${TerminalSettingPrefix.ShellArgs}.${platformKey}`, e); logService.error(`Could not resolve ${TerminalSettingPrefix.ShellArgs}${platformKey}`, e);
resolvedArgs.push(arg); resolvedArgs.push(arg);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册