Thank You, Screen!

by chromatic

Despite my best efforts, I occasionally have to perform system administration. This often means checking logs, reading man pages, typing commands, and editing configuration files--often on a remote system. I have a great little shell script that opens several Xterms in the appropriate way on my local machine under an X11 session, but that doesn't always work on remote systems.

That's just one reason to love GNU Screen. All of a sudden, one remote login can host a handful of command-line sessions. It's easy to flip back and forth as necessary.

I used screen off and on for a few years, until someone (I forget whom, sadly) taught me the most useful trick of all. I use Ctrl-a and Ctrl-e to jump to the start and end of Bash lines, but screen uses Ctrl-a as its hotkey. At least, it does until you add one line to your ~/.screenrc:

escape \034\034

Now Ctrl-\ is my hotkey; I never type that by accident, and Ctrl-a does exactly what it should do. There's no pain in using screen anymore, and I'm a convert. Thanks to all of the screen developers and contributors!


2007-04-10 14:47:40
Screen is great indeed! You can also use F-keys. For example, I use F12.

From my .screenrc :

escape ""
bindkey -k F2 command

2007-04-16 14:24:29
"Ctrl-a a" does the trick as well...
Dominic Mitchell
2007-04-17 00:29:21

Yes, we know that C-a a works by default. But when you have 15 years of emacs experience telling you that C-a is go to beginning of line, it gets frustrating real quick if you don't change it.

Amit Patel
2007-04-17 09:43:35
I love screen. I use C-z for the hotkey, since C-z in my mind is the key to use for running multiple programs in one terminal.