8000 Double escaped SSH commands · Issue #4650 · wp-cli/wp-cli · GitHub
[go: up one dir, main page]

Skip to content

Double escaped SSH commands #4650

@johnbillion

Description

@johnbillion

When running a command over SSH (eg. via the --ssh flag or an @-alias), the contents of the command flag appears to be double escaped.

Example:

wp --ssh=foo plugin list --debug

Results in:

Running SSH command: ssh -q 'foo' -t 'wp '\''plugin'\'' '\''list'\'' '\''--debug'\'''

I would expect it to be:

Running SSH command: ssh -q 'foo' -t 'wp plugin list --debug'

The double escaping appears to come from two calls to escapeshellarg, first inside WP_CLI\Runner::run_ssh_command() and secondly within the corresponding condition in WP_CLI\Runner::generate_ssh_command() (and conditions above that for Docker, Vagrant, etc).

Is there a reason for the double escaping that I'm missing?

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0