Solaris Command : screen

Name: terminal/screen
Summary: GNU Screen
Description: GNU Screen terminal multiplexer
Category: Applications/System Utilities
Version:4.0.3
FMRI: pkg://solaris/terminal/screen

 
Key Action Notes
Ctrl+a c new window
Ctrl+a n next window I bind F12 to this
Ctrl+a p previous window I bind F11 to this
Ctrl+a “ select window from list I have window list in the status line
Ctrl+a Ctrl+a previous window viewed



Ctrl+a S split terminal horizontally into regions Ctrl+a c to create new window there
Ctrl+a | split terminal vertically into regions Requires debian/ubuntu patched screen 4.0
Ctrl+a :resize resize region
Ctrl+a :fit fit screen size to new terminal size Ctrl+a F is the same. Do after resizing xterm
Ctrl+a :remove remove region Ctrl+a X is the same
Ctrl+a tab Move to next region



Ctrl+a d detach screen from terminal Start screen with -r option to reattach
Ctrl+a A set window title
Ctrl+a x lock session Enter user password to unlock
Ctrl+a [ enter scrollback/copy mode Enter to start and end copy region. Ctrl+a ] to leave this mode
Ctrl+a ] paste buffer Supports pasting between windows
Ctrl+a > write paste buffer to file useful for copying between screens
Ctrl+a < read paste buffer from file useful for pasting between screens



Ctrl+a ? show key bindings/command names Note unbound commands only in man page
Ctrl+a : goto screen command prompt up shows last command entered

My screenrc file as below:
#cat ~/.screenrc
#caption always "%?%F%{-b 4w}%:%{-b bb}%? %H | %l | %m-%d %c |%?%F%{-b 4w}%?%L=%-Lw%45>%{-b w4}%n%f* %t%{-}%+Lw%-0<"
#caption always "%m-%d %c |%?%F%{-b 4w}%?%L=%-Lw%45>%{-b w4}%n%f* %t%{-}%+Lw%-0<"
vbell off
termcapinfo xterm ti@:te@

autodetach on # Autodetach session on hangup instead of terminating screen completely

startup_message off # Turn off the splash screen

defscrollback 99999 # Use a 30000-line scrollback buffer

zombie kr

#caption always "%{= KG} %Y-%m-%d %c |%?%F%{-b 4w}%?%L=%-Lw%45>%{-b w4}%n%f* %t%{-}%+Lw%-0<"
#caption always "%{= KG} %H |%?%F%{-b 4w}%?%L=%-Lw%45>%{-b w4}%n%f* %t%{-}%+Lw%-0<"

caption always "%{rw}%n%f %t %{wk} | %?%-Lw%?%{wb}[%n*%f %t]%?(%u)%?%{wk}%?%+Lw%? %{wk}"

hardstatus alwayslastline "%{+b kr}host: %{kw}%H %{kg} | %c | %{ky}%d.%m.%Y | %{kr}(load: %l)%-0=%{kw}"

#caption always "%{= wk} %{= KY} [%n]%t %{-} %= %{= KR} %l %{-} | %{= KG} %Y-%m-%d %{-} "
#hardstatus alwayslastline " %-Lw%{= Bw}%n%f %t%{-}%+Lw %=| %0c:%s"
#
activity                            "activity in %n (%t) [%w:%s]~"

# ------------------------------------------------------------------------------
# SCREEN KEYBINDINGS
# ------------------------------------------------------------------------------

# Remove some stupid / dangerous key bindings
#bind ^k
#bind L
#bind ^\
# Make them better
#bind \\ quit
#bind K kill
#bind I login on
#bind O login off
#bind } history

# An example of a "screen scraper" which will launch urlview on the current
# screen window
#
#bind ^B eval "hardcopy_append off" "hardcopy -h $HOME/.screen-urlview" "screen urlview $HOME/.screen-urlview"

# k1 is f1; ie f1 jumps to window 1
#bindkey -k k4    quit
bindkey -k k5    next
bindkey -k k4    prev
bindkey -k k6    select 4
bindkey -k k7    select 5
bindkey -k k8    quit

# Using tab to move around regions gets annoying.    These help.
bind ^j focus down
bind ^k focus up
bind ^h focus top
bind ^l focus bottom

#Remove Ctrl+k, Ctrl+a k, then bind ctrl+a,shift+k to 'kill' command
#Remove Ctrl+s, Ctrl+a s, Ctrl+a S bind
bind ^k
bind k
bind K kill
bind ^s
bind s
bind S

# ------------------------------------------------------------------------------
# caption description:
# ------------------------------------------------------------------------------
#
# caption always "%?%F%{-b bc}%:%{-b bb}%?%C|%D|%M %d|%H%?%F%{+u wb}%? %L=%-Lw%45>%{+b by}%n%f* %t%{-}%+Lw%-0<"
#
# Anything I don't describe is treated literally.
#
# %?                    - Start of a conditional statement.
#    %F                 - Use this part of the statement if the window has focus (i.e. it
#                             is the only window or the currently active one).
#    %{-b bc}     - Turn off bold, blue foreground, cyan background.
# %:                    - else
#    %{-b bb}     - Turn off bold, blue foreground, blue background (this obscures
#                             the text on non-focused windows and just gives a blue line).
# %?                    - End conditional statement.
#    %C                 - time (hh:mm, leading space) in 12 hour format
#    %D                 - Three-letter day-of-week appreviation
#    %M                 - Three-letter month appreviation
#    %d                 - Day of the month
#    %H                 - hostname
#    %?                 - Start of conditional statement.
#     %F                - Use this part of the statement if the window has focus.
#     %{+u wb}    - underlined, white foreground, blue background
#    %?                 - End conditional (if not focused, text remaind blue on blue).
#        %L=            - truncation/padding point.    With the 'L' qualifier, basically
#                             just acts as a reference point.    Further truncation/padding is
#                             done relative to here, not the beginning of the string
#        %-Lw         - window list up to but not including the current window (-),
#                             show window flags (L)
#        %45>         - truncation/padding marker; place this point about 45% of the
#                             way into the display area (45)
#        %{+b by} - add bold (still underlined from before), blue foreground,
#                             yellow background
#            %n         - number of the current window
#            %f         - flags for current window
#            %t         - title of current window
#        %{-}         - undo last color change (so now we're back to underlined white
#                             on blue)    (technically, this is a pop; a second invocation
#                             would drop things back to unadorned blue on cyan)
#        %+Lw         - window list from the next window on (-), show window flags (L)
#        %-0<         - truncation/padding point.    Place this point zero spaces (0)
#                             from the right margin (-).


http://www.ibm.com/developerworks/cn/linux/l-cn-screen/
http://roclinux.cn/?p=1742