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

getRemoteOSAndProcesses uses bash #569

Closed
andyneff opened this issue Mar 15, 2017 · 1 comment · Fixed by #2340
Closed

getRemoteOSAndProcesses uses bash #569

andyneff opened this issue Mar 15, 2017 · 1 comment · Fixed by #2340
Labels

Comments

@andyneff
Copy link
Contributor

Not all Linuxes have bash, but practically all of them have sh. From what I can see, there are no features from bash that are not in sh being used. Would it be possible to change the attachToProcess.js from

        const command = `bash -c 'uname && if [ $(uname) == "Linux" ] ; then ${nativeAttach_1.PsProcessParser.psLinuxCommand} ; elif [ $(uname) == "Darwin" ] ; ` +
            `then ${nativeAttach_1.PsProcessParser.psDarwinCommand}; fi'`;

to

        const command = `sh -c 'uname && if [ $(uname) == "Linux" ] ; then ${nativeAttach_1.PsProcessParser.psLinuxCommand} ; elif [ $(uname) == "Darwin" ] ; ` +
            `then ${nativeAttach_1.PsProcessParser.psDarwinCommand}; fi'`;

This comes up more often when using the pipeTransport to debug on other operating systems.

@alex-che
Copy link

Stumbled upon the same problem when trying to set up vscode remote debugging with an embedded Linux device. Ended up making the same changes in attachToProcess.js and it helped. Seems like using 'bash' does not give anything useful here, but sacrifice cross-platformability.

andyneff added a commit to andyneff/vscode-cpptools that referenced this issue Jul 30, 2018
WardenGnaw pushed a commit that referenced this issue Jul 30, 2018
asialasr pushed a commit to asialasr/vscode-cpptools that referenced this issue Mar 12, 2021
Merging release-cpptools back into master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants