achiurizo / consular

Terminal automation
http://rdoc.info/github/achiu/consular/master/file/README.md
MIT License
813 stars 46 forks source link

Is there a way to interact with programs running within the opened tab? #97

Open jannisg opened 12 years ago

jannisg commented 12 years ago

To setup my full work environment I would ideally like to:

  1. Tab 1: Start MongoDB
  2. Tab 2: Open the MongoDB shell (mongo)
  3. within Tab 2 we're now inside the mongo client, waiting for input.
  4. within Tab 2 I would now like to connect to my project's DB (use db_name) then authenticate via db.auth( 'user', 'pass' )

I could easily get step 1 and 2 accomplished but trying to then run code within Tab 2 is where I got stuck… is there any way this can be done?

Thanks for reading.

Below is my full script in case that helps which is run via consular start scst in Terminal.app (OSX 10.7)

# Setup the dev environment for the SCST project.
setup 'echo "setup"'

# CD into project directory
before { run 'cd ~/Sites/git/scst/scst' }

# Start MongoDB
tab "mongo_start" # note: this is an alias available in my system

# Connect to MongoDB shell
tab do
    run "mongo" # open the mongo shell
    run "use scst" # within mongo, connect to project's DB
    run "db.auth('user', 'pass')" # authenticate to this DB.
end

# Start the Play framework
tab "play run"

# Start Compass compiler process
tab "compass watch"

# Open a new tab in the correct project directory.
tab "echo 'SCST Environment is ready to go...'"