0

I'm using Linux Mint 18 XFCE. Drush perfectly works, except for this annoying issue that it does not let me autocomplete file or directory names in a drush command.

Lets say that I want to sync my production files folder to my local files folder, so the command is:

drush rsync @site.prod:sites/default/files sites/default/files

When I'm typing the following parts I can pres tab and they are autocompleted:

  • drush
  • rsync
  • @site.prod

But when I'm typing sites/default/files it is not autocompleted, so I have to manually write the whole text, twice in this example.

It should be possible to do it in Linux because that's the normal behavior in Mac.

Just in case, here is the drush status result:

 Drupal version                  :  7.50                                           
 Site URI                        :  http://default                                 
 Database driver                 :  mysql                                          
 Database hostname               :  localhost                                      
 Database username               :  icolma                                         
 Database name                   :  icolma                                         
 Database                        :  Connected                                      
 Drupal bootstrap                :  Successful                                     
 Drupal user                     :  Anónimo                                        
 Default theme                   :  cornelius                                      
 Administration theme            :  seven                                          
 PHP configuration               :  /etc/php/7.0/cli/php.ini                       
 Drush version                   :  5.10.0                                         
 Drush configuration             :                                                 
 Drush alias files               :  /home/juankvillegas/.drush/aliases.drushrc.php 
 Drupal root                     :  /home/juankvillegas/git-repositories/icolma    
 Site path                       :  sites/default                                  
 File directory path             :  sites/default/files                            
 Private file directory path     :  sites/default/files/private                    
 Temporary file directory path   :  /tmp   
  • That's almost certainly an issue with your shell and not drush – Clive Oct 7 '16 at 18:13
  • @Clive, maybe, but the file and folders autocomplete works normally when I'm not writing a Drush command. – juankvillegas Oct 7 '16 at 18:22
  • I believe (but might be wrong) that bash/fish/whatever takes on that autocomplete, and invokes it when it thinks there's a break between arguments passed to a command. i.e. it doesn't rely on drush to tell it to do so. I'm not trying to marginalise your issue or anything, just saying that this isn't likely to be a problem with drush, so the expertise to help you might not be here – Clive Oct 7 '16 at 18:41
  • Does completion work with drush in other scenarios, for example? Like if you remove the special chars and just use plain paths? @ is a special char in bash, maybe that's upsetting it – Clive Oct 7 '16 at 18:52
  • @Clive, other command I normally use is drush sqlq --file=db.sql where db.sql is the database backup file. In that case the autocomplete does not work. – juankvillegas Oct 7 '16 at 18:57
0

The problem is caused by the Drush version (5.10.0) that is the one available in Linux Mint repositories.

Once I disabled that version and installed the most recent one following the instructions in http://docs.drush.org/en/master/install/ it started working.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.