In past few months, I worked on a project developed entirely on linux. Previously, I mostly did rails development on mac with textmate. I had a brief period of rails and perl where I did vim and screen…oh maybe 4 years ago. Anyways, so I didn’t forget much vim over the years, but I had forgotten how to use screen. I looked some documentation to refresh my memory and this post is mainly notes for me :)
Most commands start with CTRL-a I refer to each spawning of a new screen in the current session as a window.
One things i really like about screen is I can detach it on one computer… then log in somewhere else and reattach. Also handy when you are on a wifi card on the train and you get disconnected. (doh!)
then start with -r to reattach:
This creates a new terminal window
Name that window
Name your window, so its easier to keep organized
List the windows
See a list of your sessions and their number (this is why you name them) and you can use arrows to select)
You can flip through the windows in order or specify the number:
1 2 3
multiple regions in one
1 2 3 4 5
To exit a window, simply type exit. To exit and kill all windows do
Using terminal on mac or linux won’t capture the scroll back…. so you must do it through screen
To see the two (!!) pages of screen commands type:
Do you like typing?
Need the time?
Named Screen Sessions
Maybe you are working on two separate projects at once, give each one its own screen session
1 2 3
then later you can do
to reattach it and continue
One thing you can do it make it easier is to add this to your .screenrc
It will show the names of the windows you have and highlight the current one. You can see the numbers too so you can do ctrl-a # quickly to jump around.
Anyways, hope this was useful to someone. Let me know any suggestions or anything I can do better!
Sources: * Unix Screen * Screen Man Page