Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Running the core-config command results in the following:
[ed@a4suited ~]$ drush --debug conf
Bootstrap to phase 0. [0.01 sec, 2.97 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.01 sec, 3.15 MB] [bootstrap]
Loading drushrc "/home/ed/.drush/drushrc.php" into "home.drush" scope. [0.01 sec, 3.15 MB] [bootstrap]
Cache HIT cid: 6.0-dev-commandfiles-0-85c4cd9976427d939c1615b7e0830ae4 [0.02 sec, 3.17 MB] [debug]
Bootstrap to phase 0. [0.07 sec, 6.84 MB] [bootstrap]
Found command: core-config (commandfile=core) [0.1 sec, 6.84 MB] [bootstrap]
Enter a number to choose which file to edit.
[0] : Cancel
-- PHP ini files --
[1] : /etc/php5/cli/php.ini
-- Drushrc --
[2] : /home/ed/.drush/drushrc.php
2
Executing: $EDITOR /home/ed/.drush/drushrc.php &
Calling proc_open($EDITOR /home/ed/.drush/drushrc.php &);
Received SIGHUP or SIGTERM
Logged command and option names to local cache. [1.63 sec, 6.9 MB] [debug]
Command dispatch complete [1.63 sec, 6.89 MB] [notice]
Peak memory usage was 7.87 MB [1.63 sec, 6.89 MB] [memory]
[ed@a4suited ~]$
[ed@a4suited ~]$ drush --debug st
Bootstrap to phase 0. [0.01 sec, 2.97 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.01 sec, 3.15 MB] [bootstrap]
Loading drushrc "/home/ed/.drush/drushrc.php" into "home.drush" scope. [0.01 sec, 3.15 MB] [bootstrap]
Cache HIT cid: 6.0-dev-commandfiles-0-85c4cd9976427d939c1615b7e0830ae4 [0.02 sec, 3.17 MB] [debug]
Bootstrap to phase 0. [0.07 sec, 6.84 MB] [bootstrap]
Found command: core-status (commandfile=core) [0.1 sec, 6.84 MB] [bootstrap]
PHP configuration : /etc/php5/cli/php.ini
Drush version : 6.0-dev
Drush configuration : /home/ed/.drush/drushrc.php
Drush alias files :
Logged command and option names to local cache. [0.19 sec, 6.86 MB] [debug]
Command dispatch complete [0.19 sec, 6.85 MB] [notice]
Peak memory usage was 7.81 MB [0.2 sec, 6.85 MB] [memory]
[ed@a4suited ~]$
Is this a bug, or misconfiguration on my end? Thanks
Comment | File | Size | Author |
---|---|---|---|
#3 | config-bg.patch | 1.9 KB | greg.1.anderson |
Comments
Comment #1
ezeedub CreditAttribution: ezeedub commentedRelated? http://stackoverflow.com/questions/5986544/cannot-launch-interactive-pro...
Comment #2
ezeedub CreditAttribution: ezeedub commentedI'm still getting this error. The above is if $EDITOR = nano. For $EDITOR = vi, I get:
The error makes the command completely useless, and I want to use it! Any insight greatly appreciated.
Comment #3
greg.1.anderson CreditAttribution: greg.1.anderson commentedThe problem with drush config is that by convention, $EDITOR is supposed to launch an editor and wait for it to exit, whereas Drush would like control returned to the terminal as soon as the editor window opens. To get its "desired" behavior, Drush adds an & to the end of the input, so that the editor will run in the background. This kills editors such as vim, which expect to run in the terminal, and therefore cannot run in the background.
There is no good way for Drush to know if $EDITOR points to an editor that is going to run in the terminal, or in an X window. Perhaps the best thing to do would be to parameterize the &, so that the user may specify whether or not it should run in the background. You could always set $options['bg'] = TRUE if you'd like to maintain the current behavior.
Patch implementing the proposed behavior attached.
Comment #4
moshe weitzman CreditAttribution: moshe weitzman commentedAt first glance, this changes current behavior. Is this deliberate? OK for drush5? Also, I think we do the $EDITOR thing elsewhere in drush?
Comment #5
greg.1.anderson CreditAttribution: greg.1.anderson commentedWhile this does change current behavior, I do not expect the 'core-config' command to be called from external scripts, so I think it's okay. To strictly keep existing behavior, we could use
drush_get_option('bg', TRUE)
until Drush 6, and have folks use --bg=0 to make vi work. I prefer it as rolled in #3, but could go with the switch if desired.A global search of Drush revealed no other use of EDITOR, and I can't think of other places we might also do this.
Comment #6
moshe weitzman CreditAttribution: moshe weitzman commentedCommitted. I was recalling $EDITOR from early versions of #1005480: Create a new project to develop Drush entity support
Comment #7
ezeedub CreditAttribution: ezeedub commentedGreat, thanks gentlemen! Just out of curiosity, to which branch would this be committed? Or is there a delay b/w the commit and my seeing it?
I see...
I tried checking out the few you see, but didn't see the commit. (So I just applied the patch to master.)
Comment #8
greg.1.anderson CreditAttribution: greg.1.anderson commented@moshe: I think you need to push the commit.
Comment #9
greg.1.anderson CreditAttribution: greg.1.anderson commentedRe-applied the patch and pushed the commit.
Comment #10
ezeedub CreditAttribution: ezeedub commentedThanks, got it.