drush icon indicating copy to clipboard operation
drush copied to clipboard

Support command completion in Drush's DDEV config

Open weitzman opened this issue 3 years ago • 1 comments

It turns out that Symfony Console 5.4+ enables completion by default and its working in Drush. This PR configures our DDEV to demonstrate that. You must have DDEV 1.19+ (recently released).

  1. When I type drush core: and then TAB, I get no results on the first TAB and then good results on a second TAB. Anyone know whats up?
  2. I had to disable Drush's --debug option because Console ships with that option on its completion command. Can anyone find a way to harmonize this without Drush globally removing the option?
  3. I've added completion to the topic command. Anyone available to help add completion for arguments and option values for other commands? image

This PR brings in a small change to annotated-command - https://github.com/consolidation/annotated-command/pull/264

weitzman avatar Mar 19 '22 13:03 weitzman

Using this natively on MacOS:

brew install bash-completion
eval "$(drush completion bash)"

However, it doesn't work like this. Typing drush topic <TAB> results in only two newlines. The topicComplete method doesn't seem to be called. Does the ddev environment work substantially differently than the MacOS / bsd bash environment? Do you know what command the _sf_drush bash function is calling to get the generated candidates?

greg-1-anderson avatar Apr 28 '22 22:04 greg-1-anderson

Just looped back to this PR and the associated annotated-command PR. Its working well except for the fact that I have to hit tab twice. Dunno why.

I havent tried testing with on OSX since I use ZSH there and that shell is not available until Drupal 10 is on Symfony 6.2. The DDEV environment in this repo is setup for testing.

weitzman avatar Oct 30 '22 19:10 weitzman