new screen trick

domm on 2006-12-04T09:12:56

I just discovered a new screen trick.

When starting a new screen session, you can give it a name using -S:
screen -S yapc

When re-attaching later, you can specify the name of the session you want:
screen -r yapc

That's very handy, because I used to have something like 10 open 'windows' in a screen, and if I switched from working on one project (eg $dayjob) to anotherone (eg CPANTS), I had to chdir in quite a lot windows.

Now I have several screen session, one for each project, all chdired into the right directory before starting the session (which makes C-A C-c start new windows in this directory):

domm@3u ~ $ screen -ls
There are screens on:
        6338.yapc       (Detached)
        5457.veri       (Detached)
        6426.generic    (Attached)

Now, when I switch projects, I just do C-A d (detach) and then screen -l NAME and everything is nice and dandy.


good way to cut down number of windows

mr_bean on 2006-12-04T09:35:54

I'll have to try this. I have up to 20 windows, and when I get over 10, I have to type C-a ' to get the double-digit ones.

By having a number of different sessions which I detach and attach, I can get that number down below 10, and thus will just have to type C-a .