-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically populate wp-cli.local.yml for cli container #1520
base: trunk
Are you sure you want to change the base?
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Interesting 🤔 Not sure where that issue would lie, maybe with the container or the SSH connection? |
It's puzzling to me. Here you can see that Screen.recording.2024-09-04.14.37.15.webmThen once I do Ctrl+C, using the mouse scrollwheel causes bash history to be scrolled the same as if I was using Up and Down arrow keys on the keyboard. |
Also, hitting |
This issue happens in the ChromeOS Terminal app, PhpStorm's built-in terminal, and the GNOME Terminal app. |
@westonruter My first guess would be that the SSH connection does not allocate a full TTY, which would mean that interactive features (like pagers) will not work. You can try forcing the allocation of a full TTY by adding the I assume this is WP-CLI executing the actual |
Here's the debug output: Details
Of note:
|
From what I've found so far, it seems like adding the Now, the question is whether this should always be added, or whether we need a separate flag for this. |
I can confirm that adding |
Ok, the question then is whether adding the |
Should WP-CLI automatically add |
wp-cli/wp-cli#5974 looks related |
This is inspired by @swissspidy's reply to my Tweet (and blog post) about making it easier to run WP-CLI commands in wp-env. He suggests that we could use SSH as the mechanism to connect WP-CLI to the
cli
Docker container. After some digging, I found this is possible. However, it is complicated by the fact that the container IDs change every time thatwp-env start
runs. So this PR adds a lifecycle script to automatically populate thewp-cli.local.yml
with the properssh
config value.When this is done, a globally installed WP-CLI will just work when inside when wp-env is started and the user is inside the repo subdirectory.
It is indeed faster than using
npm run wp-env run cli wp
(about twice as fast), however I'm seeing some strange behavior where the pager isn't working. For example, if I dowp --help
, I can't scroll down in the text. I have to Ctrl+C to quit the pager (and then the scroll wheel in my Terminal is messed up where it starts scrolling back through my command history instead of scrolling the terminal output).