You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pickRemoteProcess SSH command variable local expansion bug #2585
While testing an attach type debugger configuration with SSH as pipeTransport on macOS/VSCode and remote target is Ubuntu Linux I found out that the pickRemoteProcess command will pick and expand the local $(uname) value instead of the remote one so the "if" statement will execute the "Darwin" "ps" command on the remote Linux target which will fail because of unsupported Linux ps command options
Command failed: "/usr/bin/ssh" "-i" "/Users/xxxx/.ssh/xxx_id_rsa" "xxx@xxxx" "sh -c 'uname && if [ $(uname) = "Linux" ] ; then ps axww -o pid=,comm=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,args= ; elif [ $(uname) = "Darwin" ] ; then ps axww -o pid=,comm=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,args= -c; fi'"
error: can not use output modifiers with user-defined output
Usage:
ps [options]
Try 'ps --help <simple|list|output|threads|misc|all>'
or 'ps --help <s|l|o|t|m|a>'
for additional help text.
For more details see ps(1).
You just need to escape any variables inside the SSH command with a backslash "\"
so it's not expanded locally
ghost changed the title [-]pickRemoteProcess SSH $(uname) local expansion bug[/-][+]pickRemoteProcess SSH command variable local expansion bug[/+]on Oct 1, 2018
Activity
[-]pickRemoteProcess SSH $(uname) local expansion bug[/-][+]pickRemoteProcess SSH command variable local expansion bug[/+]Fixing quoting around ssh's command
Fixing quoting around ssh's command (#2604)
sean-mcmanus commentedon Mar 2, 2019
Should be fixed with the latest insiders: https://github.com/Microsoft/vscode-cpptools/releases