message: Rajkumar42/wsl/pipefix
  Adding sysnative to path if running in windows for remote pipe launch
diff: import * as os from 'os';
  import * as vscode from 'vscode';
  import * as child_process from 'child_process';
  +import { PlatformInformation } from '../platform';
  export interface AttachItem extends vscode.QuickPickItem {
  id: string;
  @@ -389,10 +390,27 @@ function execChildProcess(process: string, workingDirectory: string): Promise<st
  });
  }
  +// VSCode cannot find the path "c:\windows\system32\bash.exe" as bash.exe is only available on 64bit OS.
  +// It can be invoked from "c:\windows\sysnative\bash.exe", so adding "c:\windows\sysnative" to path if we identify
  +// VSCode is running in windows and doesn't have it in the path.
  +function GetSysNativePathIfNeeded() : Promise<any> {
  + return PlatformInformation.GetCurrent().then(platformInfo => {
  + let env = process.env;
  + if (platformInfo.isWindows && platformInfo.architecture === "x86_64") {
  + let sysnative : String = process.env.WINDIR + "\\sysnative";
  + env.Path = process.env.PATH + ";" + sysnative;
  + }
  +
  + return env;
  + });
  +}
  +
  function execChildProcessAndOutputErrorToChannel(process: string, workingDirectory: string, channel: vscode.OutputChannel): Promise<string> {
  channel.appendLine(`Executing: ${process}`);
  +
  return new Promise<string>((resolve, reject) => {
  - child_process.exec(process, { cwd: workingDirectory, maxBuffer: 500 * 1024 }, (error: Error, stdout: string, stderr: string) => {
  + return GetSysNativePathIfNeeded().then(newEnv => {
  + child_process.exec(process, { cwd: workingDirectory, env: newEnv, maxBuffer: 500 * 1024 }, (error: Error, stdout: string, stderr: string) => {
  let channelOutput = "";
  if (stdout && stdout.length > 0) {
  @@ -418,5 +436,6 @@ function execChildProcessAndOutputErrorToChannel(process: string, workingDirecto
  resolve(stdout);
  });
  });
  + });
  }
  