3

This might be a dumb question and is probably more of a general question for using the command line, but how can I create a command setting where drush is set in the current terminal session. I already have the correct path set where I don't have to type the full path to drush every time, but I'd like to be able to open the terminal up with drush set in the session until I exit the terminal.

For instance instead of opening up terminal and having to type drush everytime:

$ drush dl ctools

$ drush en ctools

$ drush .... (everything else that you want to do)

I can open up the terminal where drush is already set, something like this where drush becomes the user and I don't have to type it:

drush$ dl ctools, pathauto, ... drush$ en ctools

3
  • 2
    Sounds complicated - couldn't you just add an alias to drush in your bash profile? Something like alias d="drush", then you could use d dl, d en, etc.
    – Clive
    Commented May 26, 2013 at 23:40
  • This issue is already closed-fixed in module's issue queue drupal.org/node/543550
    – Mołot
    Commented May 27, 2013 at 7:50
  • I would like an update to drush that opened a drush shell that meant you didn't have to bootstrap it on every command. Doesn't exist though.
    – Interlated
    Commented May 27, 2013 at 12:28

2 Answers 2

1

This functionality was added in 2010 and removed in 2012. "By the book" way is to use bash with bash completion and optionally bash aliases. Or you can wrap it into a simple php / bash / c program that will automatically prepend drush -l $yoursitename to everything you write and execute the result, and use that as your small simple shell. But you would give up bash completion then.

1

I would suggest making a few aliases:

alias cc='drush cc'
alias en='drush en'
alias dl='drush dl'

Assuming you aren't using these for something else, it is an easy way to make drush commands that you use all the time much more accessible.

You can put that script in ~/.bash_aliases and it will appear for all terminal sessions.

If you use alias.sh simply click "Use" on this alias http://alias.sh/common-drush-commands to import them into your bash profile.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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