We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7326c6f commit a3fbfadCopy full SHA for a3fbfad
src/commands/ssh.ts
@@ -137,7 +137,12 @@ const ssh = async (args: yargs.ArgumentsCamelCase<SshCommandArgs>) => {
137
id,
138
// the command to run on the remote machine, if any
139
command: args.command
140
- ? `${args.command} ${args.arguments.join(" ")}`.trim()
+ ? `${args.command} ${args.arguments.map(shellEscapeArgument).join(" ")}`.trim()
141
: undefined,
142
});
143
};
144
+
145
+// Helper function to support double quotes (") in commands such as `p0 ssh <instance>> echo 'hi; "mom"'`
146
+const shellEscapeArgument = (argument: string) => {
147
+ return `"${argument.replace('"', '\\"')}"`;
148
+};
0 commit comments