When working on a rails project I usually have script/server, script/console and autotest all running in GNU Screen. Jamie Flournoy has already described why using GNU screen is better than plain old Terminal Tabs.
I've put together a Screen Textmate Bundle to make it easy to configure and open per project screen sessions.
Installation
Run this:
cd ~/Library/Application\ Support/TextMate/Bundles
git clone git://github.com/mocoso/screen.tmbundle.git Screen.tmbundle
Set up your screen configuration for a project
Create a .screenrc file in your project directory if you want to specify a particular configuration for your project.
For example for a Ruby on Rails project you might create a .screenrc file in your project directory like this
# Have the server running in screen 1
#
# Stuff is used so that when you exit the stuff-ed program, you drop back
# to the bash shell for that screen instead of immediately exiting that
# screen. This is useful for "^c, up-arrow, enter" restarting of programs.
screen -t server 1
stuff "script/server\012"
# Have autotest running in screen 2
screen -t autotest 2
stuff "autotest\012"
# Have the console running in screen 3
screen -t console 3
stuff "script/console\012"
# Finally have a command line prompt at the project root in screen 4
screen -t project_root 4
Usage
Use this bundle's 'Start Session' command (ctrl-shift-s) to start (or reconnect to) your project's screen session.
If you have created a .screenrc file in your project directory then this will be used to initialize the new session.
Update (14th Sep 2008)
On Jonathon Palardy's suggestion I've added a 'Send to Screen' command (ctrl-alt-c) that copies selected text (or current line if no selection made) to your project's screen session. If you have multiple windows open in the session then it will paste to the currently selected window.
Update (22nd Jan 2009)
If you want similar functionality without learning screen then check out Nick Rutherford's Rails Workbench
Comments (4)
Add Comment