mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
parent
960217faf7
commit
ac44885672
|
@ -69,9 +69,9 @@ export class TerminalProfileQuickpick {
|
|||
if (result.profile.args) {
|
||||
newProfile.args = result.profile.args;
|
||||
}
|
||||
(profilesConfig as { [key: string]: ITerminalProfileObject })[result.profile.profileName] = newProfile;
|
||||
(profilesConfig as { [key: string]: ITerminalProfileObject })[result.profile.profileName] = this._createNewProfileConfig(result.profile);
|
||||
await this._configurationService.updateValue(profilesKey, profilesConfig, ConfigurationTarget.USER);
|
||||
}
|
||||
await this._configurationService.updateValue(profilesKey, profilesConfig, ConfigurationTarget.USER);
|
||||
}
|
||||
// Set the default profile
|
||||
await this._configurationService.updateValue(defaultProfileKey, result.profileName, ConfigurationTarget.USER);
|
||||
|
@ -131,14 +131,10 @@ export class TerminalProfileQuickpick {
|
|||
if (!name) {
|
||||
return;
|
||||
}
|
||||
const newConfigValue: { [key: string]: ITerminalExecutable } = { ...configProfiles };
|
||||
newConfigValue[name] = { path: context.item.profile.path };
|
||||
if (context.item.profile.args) {
|
||||
newConfigValue[name].args = context.item.profile.args;
|
||||
}
|
||||
if (context.item.profile.env) {
|
||||
newConfigValue[name].env = context.item.profile.env;
|
||||
}
|
||||
const newConfigValue: { [key: string]: ITerminalExecutable } = {
|
||||
...configProfiles,
|
||||
[name]: this._createNewProfileConfig(context.item.profile)
|
||||
};
|
||||
await this._configurationService.updateValue(profilesKey, newConfigValue, ConfigurationTarget.USER);
|
||||
},
|
||||
onKeyMods: mods => keyMods = mods
|
||||
|
@ -215,6 +211,17 @@ export class TerminalProfileQuickpick {
|
|||
return result;
|
||||
}
|
||||
|
||||
private _createNewProfileConfig(profile: ITerminalProfile): ITerminalExecutable {
|
||||
const result: ITerminalExecutable = { path: profile.path };
|
||||
if (profile.args) {
|
||||
result.args = profile.args;
|
||||
}
|
||||
if (profile.env) {
|
||||
result.env = profile.env;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private async _isProfileSafe(profile: ITerminalProfile | IExtensionTerminalProfile): Promise<boolean> {
|
||||
const isUnsafePath = 'isUnsafePath' in profile && profile.isUnsafePath;
|
||||
const requiresUnsafePath = 'requiresUnsafePath' in profile && profile.requiresUnsafePath;
|
||||
|
|
Loading…
Reference in a new issue