I've known about screen for a few years. I never did use it until recently though. When I tried it out a few years ago I came away with the impression that it wasn't worth the trouble since I'd have to learn another set of keystrokes. When I tried it back then, I didn't like Ctrl-A or any of the other keystrokes that came with it (all prefixed with Ctrl-A).
Of course the activating keystroke (Ctrl-A) can be configured to be something else, but the rest of the keystrokes still seemed unnecessary cruft to learn.
I recently looked at screen again though and I've fallen in love with it. I don't use it as efficiently as I might. I still have a problem with the keystrokes, so I learn the minimum that I need (Ctrl-Ad, Ctrl-AA, Ctrl-A[, Ctrl-A],Ctrl-An, Ctrl-Ap, Ctrl-A", Ctrl-AX) and leave the other commands alone until I find that I need them. I still only have limited space in my brain for keystrokes, so I economize.
The problem with screen now is that I've got 8 processes running in screen at work (I'm working remotely because my baby is sick and I need to be home to help take care of him). I can barely multi-task 3-4 processes, and now I'm running 8. Of course, they're all long running database processes and once they're set up they run independently until they complete. I could then move on to another set of 3-4 things to do. I avoid doing that too though since when any in the first set of tasks finish, I'll have forgotten what the purpose of it was :-). And frankly, some of these tasks are going to take hours. I can't afford to keep adding sets of 3-4 tasks until I can't count them anymore :-).
I do find screen very useful though. Mainly, as a replacement for nohup. Now I can start a screen session remotely, run the program in screen, give it any interactive commands it might need (hard with nohup) and then leave it running. Previously, I'd have problems with running a program over ssh (when the vpn would burp, I might lose the session, I certainly couldn't control it remotely anymore). And nohup has problems with interactivity. Screen is a great help there since I can get interactivity, and if ssh breaks because of network issues, I just ssh there again and re-attach to the screen.
I didn't know about -x back then too, when I was first looking at screen. I like working with 3 or 4 actual terminals on my monitor. That's one reason I don't like KDE, it's necessary to manually detach a tab. In gnome, I can just turn off the menus (in fact, I use aterm now, but for a while I was using gnome-terminal) and have terminal windows automatically open in new windows rather than tabs (when I do Ctrl-Shift-N in one terminal it creates a new terminal as a separate window.
For screen, I just ssh to the remote box, screen -x, do that 3 or 4 times, and then have each terminal go to a different screen sub-session (Ctrl-Alt-" or Ctrl-Alt-n a few times).
I've even used screen for discussing/team-programming. The several people in the discussion all connect to the same screen session and then discuss, view, and test code while all looking at the same editor sessions, debug screens, etc. That works for command line work, or just basic code slinging. of course, testing in a browser, or in some graphical environment is harder. I've avoided those complexities for now though, although of course vnc is waiting in the wings for when I need it.
No comments:
Post a Comment