make comspec setting optional - fixes #4143

This commit is contained in:
Eugene Pankov
2021-07-06 19:03:34 +02:00
parent 41a53a3e8e
commit d3498a6a46
4 changed files with 18 additions and 1 deletions

View File

@@ -15,6 +15,7 @@ export class TerminalConfigProvider extends ConfigProvider {
showBuiltinProfiles: true,
environment: {},
profiles: [],
setComSpec: false,
},
}

View File

@@ -122,7 +122,13 @@ export class Session extends BaseSession {
...this.config.store.terminal.environment || {},
}
if (this.hostApp.platform === Platform.Windows) {
if (this.hostApp.platform === Platform.Windows && this.config.store.terminal.setComSpec) {
for (const k of Object.keys(env)) {
if (k.toUpperCase() === 'COMSPEC') {
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete env[k]
}
}
env.COMSPEC = this.bootstrapData.executable
}