6

I'm a Ruby on Rails Web Developer and there is a lot of repetition I go through to start up my development environment. I was wondering if there is any way that I can remove some of this repetition by writing a script, or using a program (like quicksilver) or something to get my work environment going. I know how to use quicksilver to open up terminal, and I even have a saved window group to get my 3 or 4 panes open.

The next thing I would love to automatically happen is getting all three to goto a certain directory, and each run different commands. One will start the local server, and in another tab, start a background process. the other would open text mate, and then start a console session, while the last one runs a svn(or git) status. Oh yah, and I would love to go ahead and open firefox, and a few tabs going to a couple of locations.

Does anyone have any suggestions on how I could make all this happen in once quicksilver command, or a double click on some type of script on my Desktop?

6

First, you can set up multiple terminal windows, each of which can start up with a command. Just go to Terminal --> Preferences --> Settings, and create a window for each of the commands you want to kick off. Next, Terminal has the concept of "Window Groups". Open those terminal windows you want to kick off, and then save them as a window group using Window --> Save Windows as Group. Finally, you can start up Terminal using a window group. Go back to Terminal --> Preferences, and go to Start this time. Under "On open, start", select "Window Group" and then the window group you created. This will make it so on start up, terminal will kick off that group. If you just want to be able to kick off the group, but not do it on start up, just skip the last part, naturally.

2

To open another Terminal window in Mac OSX, simply hit cmd + T from the command line.

  • 2
    This answer only covers a very small portion of what the user was asking. When posting an answer, please try to address all issues that the requester has posted. Small and quick-fix solutions should be reserved for general comments to the original post. – Will.Beninger May 24 '14 at 21:16
1

I suppose this might help you

function tab() {
  while read hostname
  do
  {
    osascript 2>/dev/null <<EOF
    tell application "System Events"
      tell process "Terminal" to keystroke "t" using command down
    end
    tell application "Terminal"
      activate
      #do script with command "cd \"$PWD\"; $*" in window 1
      do script with command "ssh root@$hostname" in window 1
    end tell
EOF
  }
  done < "$1"
}

I added this function in my .bash_profile and then source the .bash_profile and invoke it using tab hostnames.txt where hostnames.txt is text file containing a list of IP Addresses that I want to ssh to, assuming that ssh key pair is already setup.

Reference: https://stackoverflow.com/questions/7171725/open-new-terminal-tab-from-command-line-mac-os-x/8188174#8188174

0

Terminal window groups are great unless you're running multiple projects, then they become a little cumbersome and you might want to try something more flexible and powerful:

https://github.com/achiu/terminitor

This is a ruby gem

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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