I would like to automate a scenario when I am working on a rails project, and I think screen is the perfect way to accomplish this without having to drag and drop multiple windows after every startup (it makes me angry when I have to touch my mouse).
Idealy I will type:
$ ./bitchin_screen_automation project_name
There are a few tools that I always launch when working with rails (in this order) rails server, spork, autotest, and a printout of sql commands being executed to the database.
It usually ends up in a formation looking similar to:
The following .screen rc generates something similar, but I cannot figure out how to automate the commands to start the rails server in each of the splits, nor pass any commands to them. It would also be nice if I could change the directory in one of them to the project directory. Is it even possible to pass arguments to an RC file? I know screen has the -c command for specifying different RC files, so that may work as a last resort, and I will just write a new one for my projects, or write a script to generate them.
screen -t home split -v focus right screen -t home focus left split split -v focus left screen -t home
So in Summary:
1) How can I script startup commands in my splits
2) Any way to pass arguments to the rc file (project directory)
3) BONUS: It would also be great if someone could tell me how I can detach and reattach a session without losing the splits as well, I read somewhere it was not possible, but I am sure someone has a hacked together solution EDIT: Found the solution to this, from the screen FAQ