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
Comment #2
helmo commentedThis 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.
Comment #3
alexmoreno commentedjust for the purpose of documenting, this is the solution:
drush @alias --no-browser ulireally annoying until I forgot about it and found a colleague doing it lol
Comment #4
alexmoreno commentedfixed in D7, probably also in D8
Comment #6
arnoldbird commentedThe solution in #3 doesn't work in D7.
Correction: It does work with Drupal 7 and Drush 8.
Comment #7
crystaldawn commentedI 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?