how to map pfkeys to screen -r cmds

Jez Hancock jez.hancock at
Sun Nov 16 01:59:48 PST 2003

On Fri, Nov 14, 2003 at 07:04:18PM -0500, Marty Landman wrote:
> Thought I recently read something in the Handbook about being able to 
> switch screens easily using the pfkeys but didn't see the how of it. Today 
> learned the screen cmd following a tip from the fbds Diary but the 
> usefulness would be greatly enhanced with some quick way to go through the 
> screens. How hard is this effect to set up, either with or w/o screens? 
> Also I'm ssh'ing into my session in case that matters.
The way I use screen:

- type 'screen' to start a new screen session

- type 'ctrl-a c' to create a new screen tty - usually one screen for
  logfiles, one for top, one for trafshow, etc etc

- to switch from one screen to another, type 'ctrl-a n' (to goto the
  next screen) or 'ctrl-a p' (to goto the previous screen).  Note this
  only works when you're in a screen session - doesn't work if you're
  just in a normal tty/console/ssh session.

- another nice way to choose which screen to jump to is to type: 
  'ctrl -a "'
  which gives you a list of current screens to scroll through with your
  arrow keys.  You can also name the screens to make them more memorable
  when using this technique using 'ctrl-a A'

- to 'detach' from screen type 'ctrl-a d' which will drop you back to
  the tty session you were originally in.

- to 'reattach' to a screen session type 'screen -r (-d)' - the -d switch
  forces the reattachment, doing a 'detach' first if needed (ie if
  someone else is using that screen, they'll be detached first).  Can't
  say I've ever really needed this since I only use screen on my

All of this is in the manual for screen, have a look.  There's also a
good site for screen hosted by sven guckes which has some ok stuff on

mmm which seems to be borked right now, hopefully by the time you read
this it'll be fixed (I'll mail him now:=).

Jez Hancock
 - System Administrator / PHP Developer

More information about the freebsd-questions mailing list