Clone object before applying migrated setting

Fixes #125177
This commit is contained in:
Daniel Imms 2021-06-07 12:03:21 -07:00
parent 11a1f705db
commit 0f1d4fbe89

View file

@ -377,7 +377,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
await this._configurationService.updateValue(TerminalSettingPrefix.DefaultProfile + platform, profile);
this._logService.trace(`migrated from shell/shellArgs, using existing profile ${profile}`);
} else {
const profiles = this._configurationService.inspect<{ [key: string]: ITerminalProfileObject }>(TerminalSettingPrefix.Profiles + platform).userValue || {};
const profiles = { ...this._configurationService.inspect<Readonly<{ [key: string]: ITerminalProfileObject }>>(TerminalSettingPrefix.Profiles + platform).userValue } || {};
const profileConfig: ITerminalProfileObject = { path: profile.path };
if (profile.args) {
profileConfig.args = profile.args;