diff --git a/src/features/processPicker.ts b/src/features/processPicker.ts index ebdbb5ac25..0467b0700a 100644 --- a/src/features/processPicker.ts +++ b/src/features/processPicker.ts @@ -84,7 +84,7 @@ export class RemoteAttachPicker { placeHolder: "Select the process to attach to" }; return vscode.window.showQuickPick(processes, attachPickOptions).then(item => { - return item ? item.id : null; + return item ? item.id : Promise.reject(new Error("Could not find a process id to attach.")); }); }); } @@ -119,13 +119,13 @@ export class RemoteAttachPicker { public static getRemoteOSAndProcesses(pipeCmd: string): Promise { // Commands to get OS and processes - const command = `uname && if [ $(uname) == "Linux" ] ; then ${RemoteAttachPicker.linuxPsCommand} ; elif [ $(uname) == "Darwin" ] ; ` + - `then ${RemoteAttachPicker.osxPsCommand}; fi`; + const command = `bash -c 'uname && if [ $(uname) == "Linux" ] ; then ${RemoteAttachPicker.linuxPsCommand} ; elif [ $(uname) == "Darwin" ] ; ` + + `then ${RemoteAttachPicker.osxPsCommand}; fi'`; return execChildProcessAndOutputErrorToChannel(`${pipeCmd} "${command}"`, null, RemoteAttachPicker._channel).then(output => { // OS will be on first line // Processess will follow if listed - let lines = output.split(os.EOL); + let lines = output.split(/\r?\n/); if (lines.length == 0) { return Promise.reject(new Error("Pipe transport failed to get OS and processes."));