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
WP_CLI::error( "The shell binary '{$shell_binary}' is not valid. You can override the shell to be used through the WP_CLI_CUSTOM_SHELL environment variable." );
169
169
}
170
170
171
+
$is_ksh = self::is_ksh_shell( $shell_binary );
171
172
$shell_binary = escapeshellarg( $shell_binary );
172
173
173
-
$cmd = 'set -f; '
174
-
. "history -r {$history_path}; "
175
-
. 'LINE=""; '
176
-
. "read -re -p {$prompt} LINE; "
177
-
. '[ $? -eq 0 ] || exit; '
178
-
. 'history -s -- "$LINE"; '
179
-
. "history -w {$history_path}; "
180
-
. 'echo $LINE; ';
174
+
if ( $is_ksh ) {
175
+
// ksh does not support bash-specific history commands or `read -e`/`read -p`.
176
+
// Use POSIX-compatible read and print the prompt via printf to stderr.
0 commit comments