File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,8 +77,8 @@ Feature: WordPress REPL
7777 """
7878 And STDERR should be empty
7979
80- # SHELL pointing to non-bash shell should be ignored and fall back to /bin/bash.
81- When I try `SHELL=/bin/zsh wp shell --basic < session`
80+ # SHELL pointing to non-bash binary should be ignored and fall back to /bin/bash.
81+ When I try `SHELL=/bin/sh wp shell --basic < session`
8282 Then STDOUT should contain:
8383 """
8484 bool(true)
Original file line number Diff line number Diff line change @@ -161,8 +161,9 @@ private static function is_bash_shell( $shell_path ) {
161161 if ( ! is_file ( $ shell_path ) || ! is_readable ( $ shell_path ) ) {
162162 return false ;
163163 }
164- // Check if the basename contains 'bash'.
165- return false !== strpos ( basename ( $ shell_path ), 'bash ' );
164+ // Check if the basename is exactly 'bash' or starts with 'bash' followed by a version/variant.
165+ $ basename = basename ( $ shell_path );
166+ return 'bash ' === $ basename || 0 === strpos ( $ basename , 'bash- ' );
166167 }
167168
168169 private function set_history_file () {
You can’t perform that action at this time.
0 commit comments