Title: Shell binary not getting detected correctly? · Issue #66 · wp-cli/shell-command · GitHub
Open Graph Title: Shell binary not getting detected correctly? · Issue #66 · wp-cli/shell-command
X Title: Shell binary not getting detected correctly? · Issue #66 · wp-cli/shell-command
Description: Bug Report Yes, I reviewed the contribution guidelines. Yes, more specifically, I reviewed the guidelines on how to write clear bug reports. The shell binary '/bin/bash' is not valid. The wp --info command shows the correct Shell, but wp...
Open Graph Description: Bug Report Yes, I reviewed the contribution guidelines. Yes, more specifically, I reviewed the guidelines on how to write clear bug reports. The shell binary '/bin/bash' is not valid. The wp --info...
X Description: Bug Report Yes, I reviewed the contribution guidelines. Yes, more specifically, I reviewed the guidelines on how to write clear bug reports. The shell binary '/bin/bash' is not valid. The w...
Opengraph URL: https://github.com/wp-cli/shell-command/issues/66
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Shell binary not getting detected correctly?","articleBody":"## Bug Report\r\n\r\n- [x] Yes, I reviewed the [contribution guidelines](https://make.wordpress.org/cli/handbook/contributing/).\r\n- [x] Yes, more specifically, I reviewed the guidelines on [how to write clear bug reports](https://make.wordpress.org/cli/handbook/bug-reports/).\r\n\r\n**The shell binary '/bin/bash' is not valid.**\r\n\r\nThe `wp --info` command shows the correct `Shell`, but `wp shell` does not seem to find it. Since it's not in `/bin/bash`\r\n\r\n```\r\n[sergio@samara:/var/www/nerdpress]$ wp --info\r\nOS: Linux 6.6.32 #1-NixOS SMP PREEMPT_DYNAMIC Sat May 25 14:22:56 UTC 2024 x86_64\r\nShell: /run/current-system/sw/bin/bash\r\nPHP binary: /nix/store/swkmyv7mplz46vlr9jyk7qlp2lxv19z0-php-with-extensions-8.2.19/bin/php\r\nPHP version: 8.2.19\r\nphp.ini used: /nix/store/6g69kphwfkdx4p2qn1fgwm888l15cpz7-wp-cli-2.10.0/etc/php.ini\r\nMySQL binary: /run/current-system/sw/bin/mysql\r\nMySQL version: mysql Ver 15.1 Distrib 10.11.6-MariaDB, for Linux (x86_64) using readline 5.1\r\nSQL modes: STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION\r\nWP-CLI root dir: phar://wp-cli.phar/vendor/wp-cli/wp-cli\r\nWP-CLI vendor dir: phar://wp-cli.phar/vendor\r\nWP_CLI phar path: /var/www/nerdpress\r\nWP-CLI packages dir:\r\nWP-CLI cache dir: $XDG_CACHE_HOME/wp-cli\r\nWP-CLI global config:\r\nWP-CLI project config:\r\nWP-CLI version: 2.10.0\r\n\r\n[sergio@samara:/var/www/nerdpress]$ wp shell\r\nError: The shell binary '/bin/bash' is not valid. You can override the shell to be used through the WP_CLI_CUSTOM_SHELL environment variable.\r\n\r\n[sergio@samara:/var/www/nerdpress]$ php -a\r\nInteractive shell\r\n\r\nphp > var_dump( is_file( '/run/current-system/sw/bin/bash' ) );\r\nbool(true)\r\nphp > var_dump( is_readable( '/run/current-system/sw/bin/bash' ) );\r\nbool(true)\r\nphp > exit\r\n```\r\n\r\n**Describe how other contributors can replicate this bug**\r\n\r\n- Have `get( 'SHELL' );` return something other than `/bin/bash`\r\n- Run `wp shell`\r\n\r\n\r\n**Provide a possible solution**\r\n\r\nSeems that the `wp cli info` command gets the shell binary using:\r\n[`getenv( 'SHELL' )`](https://github.com/wp-cli/wp-cli/blob/0ca6d920123ac904c918d69181edc5071dc92c9d/php/commands/src/CLI_Command.php#L126C12-L126C29)\r\n\r\nWhere `wp shell` [uses `getenv( 'WP_CLI_CUSTOM_SHELL' )` to check for a \"custom shell\", then assumes `/bin/bash` is it isn't set](https://github.com/wp-cli/shell-command/blob/main/src/WP_CLI/Shell/REPL.php#L118).\r\n\r\n[Why not use `$shell_binary = getenv( 'SHELL' );` instead of `$shell_binary = '/bin/bash';`](https://github.com/wp-cli/shell-command/blob/main/src/WP_CLI/Shell/REPL.php#L121C4-L121C32)\r\n\r\n","author":{"url":"https://github.com/ecotechie","@type":"Person","name":"ecotechie"},"datePublished":"2024-07-10T19:08:48Z","url":"https://github.com/wp-cli/shell-command/issues/66"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7d0685b4-36ba-f774-71b1-0733663f97ff |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AD5A:258059:134DB27:1AFE4AD:6AFA23FB |
| html-safe-nonce | 656d224e420ef61bd1696c7bd2bf639740e72b2531ab40087daf307b1a4d3aa6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRDVBOjI1ODA1OToxMzREQjI3OjFBRkU0QUQ6NkFGQTIzRkIiLCJ2aXNpdG9yX2lkIjoiMTg3ODQ1MDk3MDAwMjMzNDcxNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 713d1854dcf2e4fede692920bb65d7c164618070fc3bd1c1da532654ba73c12e |
| hovercard-subject-tag | issue:2401467036 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/wp-cli/shell-command/66/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3a5cf8899f7cb6f1aaa5a145f7c83e71323c62770c22bbae2c44ecf5ad1f5b7a/wp-cli/shell-command/issues/66 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3a5cf8899f7cb6f1aaa5a145f7c83e71323c62770c22bbae2c44ecf5ad1f5b7a/wp-cli/shell-command/issues/66 |
| og:image:alt | Bug Report Yes, I reviewed the contribution guidelines. Yes, more specifically, I reviewed the guidelines on how to write clear bug reports. The shell binary '/bin/bash' is not valid. The wp --info... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ecotechie |
| hostname | github.com |
| expected-hostname | github.com |
| None | 612d3e6ffd693e7ea8d9fcf452370995872baef31d825b1fedef704cd3d24ac7 |
| turbo-cache-control | no-preview |
| go-import | github.com/wp-cli/shell-command git https://github.com/wp-cli/shell-command.git |
| octolytics-dimension-user_id | 1570774 |
| octolytics-dimension-user_login | wp-cli |
| octolytics-dimension-repository_id | 85307675 |
| octolytics-dimension-repository_nwo | wp-cli/shell-command |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 85307675 |
| octolytics-dimension-repository_network_root_nwo | wp-cli/shell-command |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 072e34035c13c31543fba9f025cbbbda4210dae4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width