Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/features/processPicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>(new Error("Could not find a process id to attach."));
});
});
}
Expand Down Expand Up @@ -119,13 +119,13 @@ export class RemoteAttachPicker {

public static getRemoteOSAndProcesses(pipeCmd: string): Promise<AttachItem[]> {
// 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<AttachItem[]>(new Error("Pipe transport failed to get OS and processes."));
Expand Down