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." );
138
138
}
139
139
140
+
$is_ksh = self::is_ksh_shell( $shell_binary );
140
141
$shell_binary = escapeshellarg( $shell_binary );
141
142
142
-
$cmd = 'set -f; '
143
-
. "history -r {$history_path}; "
144
-
. 'LINE=""; '
145
-
. "read -re -p {$prompt} LINE; "
146
-
. '[ $? -eq 0 ] || exit; '
147
-
. 'history -s -- "$LINE"; '
148
-
. "history -w {$history_path}; "
149
-
. 'echo $LINE; ';
143
+
if ( $is_ksh ) {
144
+
// ksh does not support bash-specific history commands or `read -e`/`read -p`.
145
+
// Use POSIX-compatible read and print the prompt via printf to stderr.
0 commit comments