Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tasks converts sysnative path after mergeDefaultShellPathAndArgs has already done that #75516

Closed
Tyriar opened this issue Jun 14, 2019 · 0 comments
Assignees
Labels
debt Code quality issues tasks Task system issues windows VS Code on Windows issues
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Jun 14, 2019

I think it's not needed anymore unless I'm missing something.

this.terminalService.configHelper.mergeDefaultShellPathAndArgs(shellLaunchConfig, this.getDefaultShell(platform), platform);
let shellSpecified: boolean = false;
let shellOptions: ShellConfiguration | undefined = task.command.options && task.command.options.shell;
if (shellOptions) {
if (shellOptions.executable) {
shellLaunchConfig.executable = this.resolveVariable(variableResolver, shellOptions.executable);
shellSpecified = true;
}
if (shellOptions.args) {
shellLaunchConfig.args = this.resolveVariables(variableResolver, shellOptions.args.slice());
} else {
shellLaunchConfig.args = [];
}
}
let shellArgs = <string[]>shellLaunchConfig.args!.slice(0);
let toAdd: string[] = [];
let commandLine = this.buildShellCommandLine(platform, shellLaunchConfig.executable!, shellOptions, command, originalCommand, args);
let windowsShellArgs: boolean = false;
if (platform === Platform.Platform.Windows) {
// Change Sysnative to System32 if the OS is Windows but NOT WoW64. It's
// safe to assume that this was used by accident as Sysnative does not
// exist and will break the terminal in non-WoW64 environments.
if (!process.env.hasOwnProperty('PROCESSOR_ARCHITEW6432')) {
const sysnativePath = path.join(process.env.windir!, 'Sysnative').toLowerCase();
if (shellLaunchConfig.executable!.toLowerCase().indexOf(sysnativePath) === 0) {
shellLaunchConfig.executable = path.join(process.env.windir!, 'System32', shellLaunchConfig.executable!.substr(sysnativePath.length));
}
}

@Tyriar Tyriar added tasks Task system issues debt Code quality issues windows VS Code on Windows issues labels Jun 14, 2019
@alexr00 alexr00 added this to the June 2019 milestone Jun 17, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Code quality issues tasks Task system issues windows VS Code on Windows issues
Projects
None yet
Development

No branches or pull requests

2 participants