Title: When input prompt starts with '-': /bin/bash: line 1: history: -1: invalid option · Issue #75 · wp-cli/shell-command · GitHub
Open Graph Title: When input prompt starts with '-': /bin/bash: line 1: history: -1: invalid option · Issue #75 · wp-cli/shell-command
X Title: When input prompt starts with '-': /bin/bash: line 1: history: -1: invalid option · Issue #75 · 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. Describe the current, buggy behavior Type something that starts with -, i.e. -1: wp> -1 /bin/bas...
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. Describe the current, buggy behavior Type something that...
X Description: Bug Report Yes, I reviewed the contribution guidelines. Yes, more specifically, I reviewed the guidelines on how to write clear bug reports. Describe the current, buggy behavior Type something that...
Opengraph URL: https://github.com/wp-cli/shell-command/issues/75
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"When input prompt starts with '-': /bin/bash: line 1: history: -1: invalid option","articleBody":"## Bug Report\n\n- [ ] Yes, I reviewed the [contribution guidelines](https://make.wordpress.org/cli/handbook/contributing/).\n- [ ] Yes, more specifically, I reviewed the guidelines on [how to write clear bug reports](https://make.wordpress.org/cli/handbook/bug-reports/).\n\n**Describe the current, buggy behavior**\n\nType something that starts with `-`, i.e. `-1`:\n\n```\nwp> -1\n/bin/bash: line 1: history: -1: invalid option\nhistory: usage: history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg [arg...]\n=> int(-1)\n```\n\n**Describe how other contributors can replicate this bug**\n\n```\n$ wp shell\nwp> -1\n/bin/bash: line 1: history: -1: invalid option\nhistory: usage: history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg [arg...]\n=> int(-1)\n```\n\n**Describe what you would expect as the correct outcome**\n\nIf it's negative number in PHP, it should evaluate to negative number:\n\n```\nwp> -1\n=> int(-1)\n```\n\n**Let us know what environment you are running this on**\n\n```\nOS:\tLinux 5.10.0-31-amd64 #1 SMP Debian 5.10.221-1 (2024-07-14) x86_64\nShell:\t/bin/bash\nPHP binary:\t/usr/local/php8.3/bin/php\nPHP version:\t8.3.24\nphp.ini used:\t/usr/local/php8.3/conf/php.ini\nMySQL binary:\t/usr/bin/mariadb\nMySQL version:\tmariadb Ver 15.1 Distrib 10.5.29-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper\nSQL modes:\tERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION\nWP-CLI root dir:\tphar://wp-cli.phar/vendor/wp-cli/wp-cli\nWP-CLI vendor dir:\tphar://wp-cli.phar/vendor\nWP_CLI phar path:\tphar:///usr/local/bin/wp\nWP-CLI packages dir:\nWP-CLI cache dir:\t/root/.wp-cli/cache\nWP-CLI global config:\t/chroot/var/www/config/wp-cli.yml\nWP-CLI project config:\nWP-CLI version:\t2.12.0\n```\n\n**Provide a possible solution**\n\nLikely the input prompt in https://github.com/wp-cli/shell-command/blob/main/src/WP_CLI/Shell/REPL.php#L135-L144 need to be escaped?\n\nJust leave this section out if you don't know how to fix it.\n\n**Provide additional context/Screenshots**\n\nAdd any other context about the problem here.\n\nIf applicable, add screenshots to help explain (you can just drag&drop images into the Github issue).\n","author":{"url":"https://github.com/gedex","@type":"Person","name":"gedex"},"datePublished":"2025-08-20T10:02:40Z","url":"https://github.com/wp-cli/shell-command/issues/75"}
| 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:0a953b0f-8190-81c5-b428-8a724fd6f075 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A138:1EDECA:51A703A:6BD8CE0:6AFA23F7 |
| html-safe-nonce | b38ce7ce1ddd51de6577e58785ffb7accf1cae65ef5ab41b0d3f0a51fa8795af |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMTM4OjFFREVDQTo1MUE3MDNBOjZCRDhDRTA6NkFGQTIzRjciLCJ2aXNpdG9yX2lkIjoiMzY1NzkyODM3MjUzODQ1MDkzNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 55264fa47a2ed2cd27ae87758986f3c7c1246c9d0a857915568e382ec43ab5ff |
| hovercard-subject-tag | issue:3337439387 |
| 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/75/issue_layout |
| twitter:image | https://opengraph.githubassets.com/978dc4efae4cd7ce9c8f9ef0cd0332b758b6febd31a6b31a7d23bdb970809a2a/wp-cli/shell-command/issues/75 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/978dc4efae4cd7ce9c8f9ef0cd0332b758b6febd31a6b31a7d23bdb970809a2a/wp-cli/shell-command/issues/75 |
| 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. Describe the current, buggy behavior Type something that... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gedex |
| 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