info > screen

πŸ“Ÿ Screen – Virtual Terminal Manager

Screen multiplexes a physical terminal between several processes (typically interactive shells). Each virtual terminal emulates a DEC VT100 and provides scrollback history, copy/paste, and detach/reattach capabilities.

πŸš€ Quick Reference

Use CaseCommand / KeystrokeDescription
Start a new sessionscreenCreate a window with a shell
Create a new windowC-a cStart a new shell window
Detach sessionC-a dDetach and leave processes running
Reattach sessionscreen -rReattach to a detached session
List windowsC-a wShow all windows with numbers/titles
Select window by numberC-a 0…9Jump to window n
Next / Previous windowC-a n / C-a pCycle through windows
Kill current windowC-a kDestroy window (and its process)
Split region horizontallyC-a SSplit the display
Split region verticallyC-a |Vertical split
Enter copy/scrollback modeC-a [Copy text from scrollback
Paste bufferC-a ]Paste copied text
Lock screenC-a xLock terminal (requires lock program)
Quit screenC-a \Kill all windows and exit
Show help (key bindings)C-a ?Display all bound commands

πŸ“‹ Overview

Screen creates a single window with a shell (or a specified command) and gets out of your way. At any time you can create new windows, switch between them, kill windows, view a list, turn on logging, copy/paste text, and detach the whole session. All windows run independently; processes continue even when their window is not visible or when the session is detached.

Everything you type goes to the current window except the command prefix (default C-a). Commands are two strokes: one to initiate, one to act. The command character and all key bindings are fully customisable.

New windows are created with C-a c. You can also launch new windows from a shell inside an existing window: screen emacs prog.c.

If /run/utmp is writable, screen adds entries for each window (useful for talk, shutdown, etc.).

βš™οΈ Invoking Screen

Command‑line options (abbreviated):

πŸ”§ Customisation (.screenrc)

Default settings can be modified via a personal .screenrc file and/or /etc/screenrc. Environment variables $SYSSCREENRC, $SCREENRC, and $HOME/.screenrc are searched. Option -c overrides.

πŸ“ Startup Files

Commands are one per line; empty lines ignored. Arguments separated by tabs/spaces, may be quoted. # starts a comment (except in quotes). Variable substitution: $VAR or ${VAR}.

πŸ“œ Source

πŸ“ Colon (online customisation)

πŸ“– Commands

A command may be bound to a key, used in screenrc, or typed at the colon prompt. All commands can be bound to keys (since v3.3).

🧩 Default Key Bindings

KeystrokeCommandDescription
C-a 'selectPrompt for window identifier and switch
C-a "windowlist -bPresent list of all windows
C-a 0…9, -selectSwitch to window number or blank
C-a TabfocusSwitch focus to next region
C-a C-aotherToggle to previously displayed window
C-a ametaSend the command character (C-a) to window
C-a AtitleEnter a title for current window
C-a b, C-bbreakSend a break to the tty
C-a Bpow_breakClose and reopen tty line
C-a c, C-cscreenCreate new window with shell
C-a CclearClear screen
C-a d, C-ddetachDetach from terminal
C-a D Dpow_detachDetach and logout
C-a f, C-fflowCycle flow control on/off/auto
C-a FfitResize window to region size
C-a C-gvbellToggle visual bell
C-a hhardcopyWrite hardcopy to file
C-a HlogToggle logging
C-a i, C-iinfoShow info about current window
C-a k, C-kkillDestroy current window
C-a l, C-lredisplayRefresh current window
C-a LloginToggle window’s login state
C-a m, C-mlastmsgRepeat last message
C-a MmonitorToggle activity monitoring
C-a SPC, n, C-nnextSwitch to next window
C-a NnumberShow current window number / title
C-a p, C-p, C-h, BackspaceprevSwitch to previous window
C-a q, C-qxonSend ^Q (XON) to current window
C-a QonlyDelete all regions but current
C-a r, C-rwrapToggle line‑wrap
C-a s, C-sxoffSend ^S (XOFF)
C-a SsplitSplit region horizontally
C-a t, C-ttimeShow load average and time
C-a vversionDisplay version
C-a C-vdigraphEnter digraph sequence
C-a w, C-wwindowsList active windows
C-a WwidthToggle between 80 and 132 columns
C-a x, C-xlockscreenLock terminal
C-a XremoveKill current region
C-a z, C-zsuspendSuspend screen
C-a ZresetReset virtual terminal to power‑on
C-a .dumptermcapWrite .termcap file
C-a ?helpShow key bindings
C-a \quitKill all windows and exit
C-a :colonEnter command line
C-a [, C-[, ESCcopyEnter copy/scrollback mode
C-a ], C-]paste .Write paste buffer to stdin of current window
C-a {, C-a }historyCopy/paste previous (command) line
C-a >writebufWrite paste buffer to screen‑exchange file
C-a <readbufRead screen‑exchange file into paste buffer
C-a =removebufDelete screen‑exchange file
C-a _silenceMonitor window for inactivity
C-a |split -vSplit region vertically
C-a ,licenseShow copyright page
C-a *displaysShow listing of attached displays

πŸ“š Command Summary

All commands (abridged):

πŸͺŸ New Window

πŸ“ Chdir

chdir [directory] – change default directory for new windows. If omitted, $HOME.

πŸ†• Screen Command

screen [opts] [n] [cmd [args] | //group] – create a new window. Options: -f flow, -fn, -fa, -t title, -l/-ln login, -T term, -a, -h num, -M (monitoring), -L (logging). If //group, creates a container window.

🌍 Setenv

setenv var string – set environment variable for new windows. unsetenv var – unset it.

🐚 Shell

shell command / defshell command – command to create new shell. Overrides $SHELL. shelltitle title – default title for shells.

πŸ–₯️ Term

term term – set $TERM for new windows (discouraged for non‑default; use screen -T term instead).

🧩 Window Types

πŸ—‚οΈ Window Groups

Create a container with screen //group. Use group [grouptitle] to show/move windows between groups. Combines well with layouts.

πŸ”Ž Selecting a Window

β¬…οΈβž‘οΈ Next and Previous

next (C-a SPC, n, C-n) – cycle forward. prev (C-a p, C-p, C-h, Backspace) – cycle backward.

πŸ”„ Other Window

other (C-a C-a) – toggle between current and last window.

🎯 Select

select [n|-|.] (C-a N, C-a ') – switch to window number, blank (-), or current (.).

πŸ“‹ Windowlist

windowlist [-b] [-m] [-g] (C-a ") – interactive list with navigation (j/k, search, etc.). Custom format via string / title.

πŸ”Œ Session Management

βœ‚οΈ Detach

detach (C-a d) – disconnect and put session in background. autodetach state (default on) – auto‑detach on hangup. password [crypted_pw] – set reattach password.

⚑ Power Detach

pow_detach (C-a D D) – detach and SIGHUP parent process. pow_detach_msg [message] – custom message.

πŸ”’ Lock

lockscreen (C-a x) – run a lock program. $LOCKPRG or builtin.

πŸ‘₯ Multiuser Session

(requires compile‑time support) multiuser state – toggle multi‑user mode. Use acladd, aclchg, acldel, aclgrp, displays, umask, wall, writelock, su.

🏷️ Session Name

sessionname [name] – rename session (caution: old name stays in existing shells). Prefer -S option.

πŸ’€ Suspend

suspend (C-a z) – put screen in background.

❌ Quit

quit (C-a \) – kill all windows and exit.

πŸ“Œ Regions

βœ‚οΈ Split

split [-v] (C-a S, C-a |) – create a new region. Use focus to toggle.

🎯 Focus

focus [ next|prev|up|down|left|right|top|bottom ] (C-a Tab) – move input focus.

πŸ‘οΈ Only

only (C-a Q) – kill all regions but current one.

πŸ—‘οΈ Remove

remove (C-a X) – kill current region.

πŸ“ Resize

resize [opts] [ [+|-]N[%] | = | max | min | _ | 0 ] – grow/shrink region.

πŸ“ Caption

caption always|splitonly [string] – control caption display and content (default %3n %t).

πŸ“ Fit

fit (C-a F) – resize window to region size.

πŸ”³ Focusminsize

focusminsize [ (width|max|_) (height|max|_) ] – enforce minimum region size.

πŸ—ƒοΈ Layout

Subcommands: layout new [title], remove, next, prev, select, show, title, number, attach, save, autosave, dump.

βš™οΈ Window Settings

πŸ“› Naming Windows

title [windowtitle] (C-a A) – set window name. Dynamic titles: set name as search|name and embed null title escape in prompt.

πŸ–₯️ Console

console [state] – grab/release console output (needs TIOCCONS).

πŸ’€ Kill

kill (C-a k) – destroy window. Caution: rebind if you use Emacs.

πŸ”‘ Login

login [state] (C-a L) – toggle utmp entry. deflogin state sets default.

πŸ”’ Mode

defmode mode – octal pty permissions (default 0622 logged, 0600 others).

πŸ‘€ Monitor

monitor [state] (C-a M) – watch for activity. silence [state|sec] (C-a _) – watch for silence. activity message, bell_msg message customise notifications.

πŸͺŸ Windows

windows [string] (C-a w) – list all windows with status markers: * current, - previous, $ logged in, ! bell, @ activity, (L) logging, &/&& shared, Z zombie. Custom format via string escapes.

πŸ“Š Hardstatus

hstatus status – set current window’s hardstatus line. defhstatus [status] – default for new windows.

πŸ’» Virtual Terminal

πŸ“œ Control Sequences

Full VT100 emulation plus many ANSI/ISO sequences. (See manual for complete table.)

⌨️ Input Translation

Default key mappings for cursor keys, function keys, keypad, etc. (table in original).

πŸ”‘ Digraph

digraph [preset [unicode-value]] (C-a C-v) – enter digraph sequences (e.g., a" β†’ Γ€). Built‑in table for Latin‑1 etc.

πŸ”” Bell

vbell [state] (C-a C-g) – toggle visual bell. vbell_msg [message], vbellwait sec.

🧹 Clear

clear (C-a C) – clear and save to scrollback.

ℹ️ Info

info (C-a i) – show cursor position, window size, scrollback, flow, wrap, mode flags, charsets, etc. dinfo – show terminal capabilities.

πŸ”„ Redisplay

redisplay (C-a l) – full redraw. partial state – partial refresh on switch. allpartial state – global override. altscreen state – alternate screen support.

↩️ Wrap

wrap [on|off] (C-a r) – toggle line‑wrap. defwrap state.

πŸ”„ Reset

reset (C-a Z) – reset terminal to power‑on values.

πŸ“ Window Size

width [-w|-d] [cols [lines]] (C-a W) – toggle 80/132 columns. height [-w|-d] [lines [cols]] – set height.

πŸ”£ Character Processing

c1 state, gr state, bce state, encoding enc [denc], charset set, utf8 [state], and their def… counterparts. cjkwidth [state].

πŸ“‹ Copy and Paste

πŸ“‘ Copy

copy (C-a [) – enter copy/scrollback mode with vi‑like keys. Features: mark, repeat, search (/, ?, C-s, C-r), yank, append, rectangular blocks. ignorecase [on|off].

πŸ“₯ Paste

paste [registers [destination]] (C-a ]) – paste from registers/paste buffer. stuff [string] – insert string directly.

πŸ’Ύ Registers

register [-e encoding] key string, readreg [-e encoding] [register [filename]], process [key].

πŸ“¬ Screen Exchange

bufferfile [exchange-file], readbuf (C-a <), writebuf (C-a >), removebuf (C-a =).

πŸ•°οΈ History

history (C-a {, C-a }}) – recall command lines based on first letter.

πŸš€ Subprocess Execution

exec [[fdpat] newcommand [args ...]] – run a filter in the current window. Abbreviations: ! for exec, | for !..|. Examples: /bin/sh, |less, !:sed -n s/.*Error.*/\007/p.

⌨️ Key Binding

bind [-c class] key [command [args]] – define or remove a binding. bindkey for input translation tables. escape xy / defescape xy – set command character. meta (C-a a) – send literal command char. command [-c class] – simulate escape key. help (C-a ?) – show bindings.

🌊 Flow Control

flow [fstate] (C-a f) – on/off/auto. defflow for default. xon (C-a q) / xoff (C-a s) – send ^Q/^S directly. interrupt option flushes output on interrupt.

🧾 Termcap

Windows get screen termcap; can be tweaked. dumptermcap writes a .termcap file. Commands: termcap, terminfo, termcapinfo. Special capabilities: LP, Z0/Z1, WS, NF, G0, etc. Autonuke (autonuke), output buffer limit (obuflimit), character translation (XC).

πŸ’¬ Message Line

Non‑status terminals: last line used. ANSI Privacy Message can display text. hardstatus configures hardware status line. lastmsg (C-a m) repeats last message. msgminwait, msgwait control timing.

πŸ“ Logging

hardcopy [-h] [file] (C-a h) – dump screen image. log [state] (C-a H) – log window output to screenlog.N. logfile, logtstamp, hardcopydir.

🏁 Startup

echo [-n] message, sleep num, startup_message state – control .screenrc startup.

🧩 Miscellaneous

at, break, pow_break, breaktype, defbreaktype, bumpleft, bumpright, collapse, debug, license, nethack, nonblock, defnonblock, number, time, verbose, version, zombie, zombie_timeout, printcmd, rendition, sorendition, attrcolor, setsid, eval, maxwin, backtick, idle, blanker, blankerprg, zmodem, mousetrack.

πŸ”£ String Escapes

Format strings for captions, hardstatus, windowlist, etc. Escapes: %n (window number), %t (title), %f (flags), %w (window list), %h (hardstatus), %c/%C (time), %H (host), %l (load), %S (session), %{…} (attributes/colors), %?…%:…%? (conditional), %=, %> (truncation/padding), %` (backtick output).

🌍 Environment Variables

COLUMNS, LINES HOME LOCKPRG NETHACKOPTIONS PATH SCREENCAP SCREENDIR SCREENRC SHELL STY SYSSCREENRC TERM TERMCAP WINDOW

πŸ“ Files Referenced

$SYSSCREENRC, /etc/screenrc
$SCREENRC, $HOME/.screenrc
$SCREENDIR/S-<login>
/run/screen/S-<login>
/tmp/screens/screen-exchange
screenlog.[0-9]
hardcopy.[0-9]
.termcap
/usr/lib/terminfo/?/*, /etc/termcap
/run/utmp

πŸ™ Credits

Originally by Oliver Laumann; maintained by Juergen Weigert, Michael Schroeder, Micah Cowan, Sadrul Habib Chowdhury; since 2015 by Amadeusz Slawinski & Alexander Naumov. Many contributors.

πŸ› Bugs

Report bugs to screen-devel AT gnu.org. Recompile with -DDEBUG for debug output.

πŸ“¦ Installation

Requires pseudo‑ttys, select, Unix‑domain sockets. Run ./configure then make. Socket directory defaults to $HOME/.screen or /run/screen.

See INSTALLATION file in distribution.

screen
πŸ“Ÿ Screen – Virtual Terminal Manager πŸš€ Quick Reference πŸ“‹ Overview βš™οΈ Invoking Screen πŸ”§ Customisation (.screenrc)
πŸ“ Startup Files πŸ“œ Source πŸ“ Colon (online customisation)
πŸ“– Commands
🧩 Default Key Bindings πŸ“š Command Summary
πŸͺŸ New Window
πŸ“ Chdir πŸ†• Screen Command 🌍 Setenv 🐚 Shell πŸ–₯️ Term 🧩 Window Types πŸ—‚οΈ Window Groups
πŸ”Ž Selecting a Window
β¬…οΈβž‘οΈ Next and Previous πŸ”„ Other Window 🎯 Select πŸ“‹ Windowlist
πŸ”Œ Session Management
βœ‚οΈ Detach ⚑ Power Detach πŸ”’ Lock πŸ‘₯ Multiuser Session 🏷️ Session Name πŸ’€ Suspend ❌ Quit
πŸ“Œ Regions
βœ‚οΈ Split 🎯 Focus πŸ‘οΈ Only πŸ—‘οΈ Remove πŸ“ Resize πŸ“ Caption πŸ“ Fit πŸ”³ Focusminsize πŸ—ƒοΈ Layout
βš™οΈ Window Settings
πŸ“› Naming Windows πŸ–₯️ Console πŸ’€ Kill πŸ”‘ Login πŸ”’ Mode πŸ‘€ Monitor πŸͺŸ Windows πŸ“Š Hardstatus
πŸ’» Virtual Terminal
πŸ“œ Control Sequences ⌨️ Input Translation πŸ”‘ Digraph πŸ”” Bell 🧹 Clear ℹ️ Info πŸ”„ Redisplay ↩️ Wrap πŸ”„ Reset πŸ“ Window Size πŸ”£ Character Processing
πŸ“‹ Copy and Paste
πŸ“‘ Copy πŸ“₯ Paste πŸ’Ύ Registers πŸ“¬ Screen Exchange πŸ•°οΈ History
πŸš€ Subprocess Execution ⌨️ Key Binding 🌊 Flow Control 🧾 Termcap πŸ’¬ Message Line πŸ“ Logging 🏁 Startup 🧩 Miscellaneous πŸ”£ String Escapes 🌍 Environment Variables πŸ“ Files Referenced πŸ™ Credits πŸ› Bugs πŸ“¦ Installation

Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-31 10:03 @216.73.217.152
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format

^_top_^