"screen" is a program for Unix-ish systems acts as a "window manager" for non-graphic (text) terminals. SCREEN allows you to switch between programs and yet use just one "terminal". '''Don't delete unreplaced broken links; they provide useful information for future WikiGnome work:''' (Quoted from http://www.math.fu-berlin.de/~guckes/screen/ BrokenLink as of 2004-02-17) See http://www.math.fu-berlin.de/~guckes/screen/intro.html (BrokenLink as of 2004-02-17) for a decent intro. As of 2004 Apr 3, it looks like the new URL is www.guckes.net/screen, but it may not be accessible 24 hours a day. Leave this in place for a little while. Benefits (roughly in order of significance): * You don't have to open up plural xterm windows to get plural terminals -- screen gives you virtual terminals within the terminals. * It works locally and on remote sessions alike. * It provides a model that many users actually find nicer to use than windowed GUIs (no ordering windows around). At this time, the only window manager I know that can do the same (and more) is IonWindowManager. * You can detach and reattach sessions. Especially, if you do something that takes a long time, you can run it in a screen and check the results later. (E.g.: If you're ssh'd to another system, and you run screen on the remote machine, even if your localhost goes away forever, you can still reattach to your previous login with "screen -r" or "screen -x") * Screens are automatically detached on lost connections. This means your work is under yet another layer of protection. * You can do multiheaded displays. "screen -x" lets you connect several physical terminals to one screen session. Some have suggested this technique for long-distance PairProgramming. * The screen can be split into sub-windows, so that the top and bottom halves represent different virtual terminals. Here are the most common commands (all of which are preceded with an escape key, Ctrl-a by default): * c - creates a new screen * Space - Cycle forward through screens * the escape key twice (eg. Ctrl-a Ctrl-a) - Jump back to last screen * - Jump to screen # * w - list all available screens * S - split the current screen in half (ie, have 2 half-sized terminals on the screen at once) * Note that this is a capital S. If you type Ctrl-a s, screen will send an XOFF character, and the machine will stop sending data to your terminal until you type Ctrl-a q to send XON. * [ - enter a vi-like mode for scrolling back through the current screen, as well as copying and pasting (Ctrl-]) text between multiple screens. * Ctrl+d (or however else you normally log out of a shell) - remove a screen * ? - find help about all the other commands. It is also possible to define further commands. For example, I used the command ''bind '^p' screen -t python python'' to make (escape key:Ctrl-a) Ctrl-p open up the Python interpreter in another window (bind '^p' screen python), with the title Python (-t python). ---- I like screen. I think that Ctrl+a is not the best choice for the default meta-key. It is also the default emacs binding for beginning-of-line (and readline is used by '''a lot''' of terminal-based programs). -- TerrelShumway Good point. Others do this: "echo set editing-mode vi > ~/.inputrc" and get vi-keys everywhere, making it moot. But, yes, Ctrl+a + Emacs keys is a bad combo. What do you recommend instead? Personally, I find Ctrl-a to be a very usable escape key, because I have Caps Lock remapped to be left-Ctrl. Also, I prefer VimTextEditor to Emacs, so the key clobbering isn't an issue. -SckotVokes You can change the escape key. I have no idea why they set it up with Ctrl+a as default, I suspect it scares away many potential users. On new accounts, I always write ~/.screenrc file with the following line in it: escape `` (They're 'ticks', the unshifted symbol you get from the ~ key. ''[AmericanCulturalAssumption - not everyone has the same keymap.]''). I use vim but emacs on the command line as well. This allows you to rapidly switch between sessions using your left hand. If you want to type a tick, just press the key twice. The only time I tend to get caught is when I'm typing something like `date -I` in a bash command. Of course, that could also be written without backticks as $(date -I). And `d is just the 'freeze session and exit' key so you can get back to where you were with screen -r This disconnect/reconnect feature is one of the best things about screen. You can run pine in a screen session, have your session disconnect, and then come back in and just continue from where you left off where normally you would have lost the email you were typing. -- Craig Turner Although I am a user of VimTextEditor, I use emacs editing-mode in shell, so I type Ctrl+a pretty often to go to beginning-of-line. So, I use Ctrl+o as a command key(starting with screen "-e^Oo" in zshell). One thing that's inconvenient is, in vim, you use Ctrl+o to go to the old position. But I personally don't use it often(and if you *really* want to go to old position, type Ctrl+o and another o) , and I stick to that command key. The other reason why I use Ctrl+o is that I want to use both hands when switching between windows. I usually open 4~5 windows and if I use Ctrl+a, I should type Ctrl+a+1~4 with only left hand. Of course, It would be different in DvorakKeyboard. -- JiwonSeo Often typing "^Aa" instead of "^A" is not too bad... depends on how much editing you're doing. Instead of using -e on the command line you can put something like "escape ^Bb" into your .screenrc These days (2014) there is also tmux (TerminalMultiplexer), which does similar stuff to screen, but seems a little more intuitive to use (and is said to have a nicer codebase) -- Noah Birnel ''Much thanks! I've never heard of tmux before. Turns out it's available on the servers I administer and it seems slicker than screen.'' If you want something that's not very BatteriesIncluded, you might want to look into dtach with dvtm. Sometimes the constraints dvtm imposes makes me focus a little more. ---- The actual name for this program is GnuScreen ---- CategoryLinux