User Tools

Site Tools


wiki:tech:linux:screen

source: http://www.pixelbeat.org/lkdb/screen.html

alternatives: * tmux alternative * byobu screen config manager. * reptyr as another way to reattach programs to a terminal.

Note for nested screen sessions, use “Ctrl+a a” to send commands to the inner screen, and the standard “Ctrl+a” to send commands to the outer 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 screen >= 4.1
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
# Bind F11 and F12 (NOT F1 and F2) to previous and next screen window
bindkey -k F1 prev
bindkey -k F2 next

# Also for ctrl-alt right and left arrows
# Note disable in window manager to allow through
bindkey ^[[1;7D prev
bindkey ^[[1;7C next

startup_message off

# Window list at the bottom.
hardstatus alwayslastline
hardstatus string "%-w%{= BW}%50>%n %t%{-}%+w%<"

# From Stephen Shirley
# Don't block command output if the terminal stops responding
# (like if the ssh connection times out for example).
nonblock on

# Allow editors etc. to restore display on exit
# rather than leaving existing text in place
altscreen on

# Enable 256-color mode when screen is started with TERM=xterm-256color
# Taken from: http://frexx.de/xterm-256-notes/
#
# Note that TERM != "xterm-256color" within a screen window. Rather it is
# "screen" or "screen-bce"
# 
# terminfo and termcap for nice 256 color terminal
# allow bold colors - necessary for some reason
attrcolor b ".I"
# tell screen how to set colors. AB = background, AF=foreground
#termcapinfo xterm-256color 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
wiki/tech/linux/screen.txt · Last modified: 2018/10/10 17:49 by kpc

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki