Whenever I type "drush uli", it attempts to open the default browser and if successful, it would completely invalidate the login link that it provides since the browser that it opens will have stolen it. This is caused by a bug that is defaulting to --browser regardless of what option is set. Very annoying. The fix is to change this line in /usr/share/php/drush/includes/exec.inc:

 if ($browser = drush_get_option('browser', TRUE)) {

Change it to:

 if ($browser = drush_get_option('browser', FALSE)) {

Now when I type "drush uli" it will spit out the link and not open a browser. If I then type "drush uli --browser", it will correctly attempt to open the link in a browser. With it set to true, there is no way to disable --browser.

Comments

crystaldawn created an issue. See original summary.

helmo’s picture

Status: Active » Closed (won't fix)

This issue was marked closed (won't fix) because Drush has moved to Github.
If this feature is still desired, you may copy it to our Github project. For best results, create a Pull Request that has been updated for the master branch. Post a link here to the PR, and please also change the status of this issue to closed (duplicate).

Please ask support questions on Drupal Answers.

alexmoreno’s picture

just for the purpose of documenting, this is the solution:

drush @alias --no-browser uli

really annoying until I forgot about it and found a colleague doing it lol

alexmoreno’s picture

Status: Closed (won't fix) » Fixed

fixed in D7, probably also in D8

Status: Fixed » Closed (fixed)

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

arnoldbird’s picture

The solution in #3 doesn't work in D7.

Correction: It does work with Drupal 7 and Drush 8.

crystaldawn’s picture

I finally found an answer to this which I stumbled upon accidentally on my own with an errant copy/paste meant for a different command. Using: drush uli browser= will make all subsequent calls to uli display only the link and will no longer try to open a browser when typing just drush uli. Why is this still not documented anywhere in drush help for uli?