Screen!

March 23, 2007 at 2:36 pm | In osx, software | 1 Comment

Screen is one of the greatest software known to mankind, essential to manage servers via SSH on flaky connections (well, even on not so flaky connections :) ) and in general to get some complex work done when in Bash.

I’m trying to get rid of my x86 habit to use the Home and End keys to move at the beginning/end of a line, so I quickly familiarized with the CTRL+A and CTRL+E shortcuts, which are widely supported.

Unfortunately, CTRL+A is used in Screen to manage a lot of stuff, in particular for sessions management.

Reading the fine manual, I found that it is possible to use an alternative shortcut using the -e command line option; since I almost never use the suspend process shortcut (which is CTRL+Z) in bash, I settled on it:

screen -e "^Zz"

To permanently activate this change, you can use the escape command in your .screenrc file.

escape "^Zz"

In case you need to suspend a process, just type CTRL+Z followed by z.

Other quick tips for screen beginners

Just my favorite ones (please remind that I use CTRL+Z instead of the default CTRL+A, so they probably will not work for you using a default screen installation):

  • Hitting CTRL+Z then ESC puts the current session in copy/scrollback mode; in this mode, you can scroll throughout the session buffer using CTRL+B (back) and CTRL+F (forward). To exit this mode, simply hit ESC.
  • To specify the number of lines to be kept in the history buffer, use the -h command line option.
  • To use VI like search on the current session buffer, enter copy/scrollback mode and simply hit / for a forward search or ? for a backward search; please note that in copy/scrollback mode almost all VI navigation commands work, see the man page for more details.

To find out more about screen, read its man page;have no fear; it’s one of the most clear man pages out there :) .

1 Comment »

RSS feed for comments on this post. TrackBack URI

  1. screen is indeed wonderful. I wouldn’t get through my work without it.

    Being able to hit “go”, detach and head home, and then check on the process once I’ve moved machines is priceless.

    Thanks for the top about vi-like searching, I hadn’t realised that.


Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.