When trying to run commands in interactive mode, all interactive prompts are either aborted or assumes yes.

Example from documentation:
-ia, --interactive Force interactive mode for commands run on multiple targets (e.g. `drush @site1,@site2 cc --ia`).

My Test:

miked@server1:/home/drupal$ drush @sites cc --ia
.home.drupal#site1             >> Enter a number to choose which cache to clear.
.home.drupal#site1             >>  [0]  :  Cancel
.home.drupal#site1             >>  [1]  :  all
.home.drupal#site1             >>  [2]  :  drush
.home.drupal#site1             >>  [3]  :  theme-registry
.home.drupal#site1             >>  [4]  :  menu
.home.drupal#site1             >>  [5]  :  css-js
.home.drupal#site1             >>  [6]  :  block
.home.drupal#site1             >>  [7]  :  module-list
.home.drupal#site1             >>  [8]  :  theme-list
.home.drupal#site1             >> Cancelled
.home.drupal#site2             >> Enter a number to choose which cache to clear.
.home.drupal#site2             >>  [0]   :  Cancel
.home.drupal#site2             >>  [1]   :  all
.home.drupal#site2             >>  [2]   :  drush
.home.drupal#site2             >>  [3]   :  theme-registry
.home.drupal#site2             >>  [4]   :  menu
.home.drupal#site2             >>  [5]   :  css-js
.home.drupal#site2             >>  [6]   :  block
.home.drupal#site2             >>  [7]   :  module-list
.home.drupal#site2             >>  [8]   :  theme-list
.home.drupal#site2             >>  [9]   :  nodeaccess
.home.drupal#site2             >>  [10]  :  views
.home.drupal#site2             >> Cancelled

I would expect to be able to select the options interactively. I mangled a few sites running pm-update with this switch. Drush assumed 'yes' and upgraded everything instead of showing me available updates and allowing me to choose wether to proceed or not.

Comments

mgifford’s picture

Yup, tried this on 3 different machines with drush version 5.4.

greg.1.anderson’s picture

I think that the backend invoke concurrency patch must have broken interactive mode with multiple targets.

mducharme’s picture

Is there a process to get this fixed? Can you provide a reference to the patch that may have broken this so we can get some movement on this?

greg.1.anderson’s picture

I think that this can be fixed in function drush_preflight_command_dispatch() via something similar to:

   if (drush_get_option('pipe') || drush_get_option('interactive')) {
      $backend_options['interactive'] = TRUE;
    }

n.b. current code only checks 'pipe', does not check interactive. Looks like this is unrelated to the backend invoke rewrite that happened; you could use git bisect to find the commit where it broke, if you wish.

mducharme’s picture

Upon further inspection, I don't think it's a problem with the backend not receiving the switch. I tested this by adding the following to my drushrc.php file (which is basically the result of what you suggested):

$options['interactive'] = TRUE;

This is correctly picked up but I still get no interactive prompts when running the original command.

greg.1.anderson’s picture

$options['interactive'] is different than setting $backend_options['interactive'] = TRUE;, so #5 is different than the advice in #4. $backend_options control how a specific call to backend invoke should be processed; you cannot set backend options from a drushrc.php file.

greg.1.anderson’s picture

Status: Active » Fixed

Committed bdf7d80.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

mducharme’s picture

fyi: this issue was fixed somewhere between version 5.4 and 5.7

mducharme’s picture

Issue summary: View changes

renamed drupal folder for clarity after obfuscation of server details.