Conversation
|
Hello! 👋 Thanks for opening this pull request! Please check out our contributing guidelines. We appreciate you taking the initiative to contribute to this project. Contributing isn't limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation. Here are some useful Composer commands to get you started:
To run a single Behat test, you can use the following command: # Run all tests in a single file
composer behat features/some-feature.feature
# Run only a specific scenario (where 123 is the line number of the "Scenario:" title)
composer behat features/some-feature.feature:123You can find a list of all available Behat steps in our handbook. |
There was a problem hiding this comment.
Code Review
This pull request introduces Windows support for the WP-CLI shell by utilizing powershell.exe and Read-Host. Feedback highlights a lack of command history support in the new PowerShell implementation, which is a regression compared to other shells. Additionally, the removal of the shell binary validation check for non-PowerShell environments should be restored to ensure proper error handling for custom shell configurations.
| if ( $is_powershell ) { | ||
| // PowerShell uses ` (backtick) for escaping but for strings single quotes are literal. | ||
| // If prompt contains single quotes, we double them in PowerShell. | ||
| $prompt_for_ps = str_replace( "'", "''", $prompt ); | ||
| $cmd = "\$line = Read-Host -Prompt '{$prompt_for_ps}'; Write-Output \$line;"; | ||
| return "powershell.exe -NoProfile -Command \"{$cmd}\""; | ||
| } |
There was a problem hiding this comment.
The new PowerShell implementation provides basic REPL functionality, but it's missing command history support, which is a crucial feature for an interactive shell. The use of Read-Host with the -NoProfile switch on powershell.exe prevents the use of PSReadLine for history. This is a significant usability regression compared to the bash/ksh implementation which explicitly handles a history file.
Please consider implementing history support for PowerShell. This could involve:
- Manually managing a history file with PowerShell commands (e.g.,
Get-Content/Add-Content). - Interacting with the
PSReadLinemodule's history functions if it's available.
Without history, the shell is much less productive.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
No description provided.