Skip to main content
GNU Screen is a terminal multiplexer that lets you manage multiple shell sessions within a single terminal. Acting like an electronic MUX, it handles several inputs (shells) to one output (your terminal). Key features include:
  • Multiple sessions, each containing one or more windows
  • Independent windows running separate programs
  • Splitting windows into regions (panes)
  • A command prefix (default Ctrl-a) followed by command keys
  • Detachable sessions that continue running in the background
  • Socket connections, copy/scrollback mode, and extensive customization
The image is a text description of terminal multiplexers, highlighting features like multiple inputs, session management, window splitting, ease of control, detachment, socket connections, and customization.

Table of Contents


History

In the era of physical VT100 terminals (1970s/80s), users had no windowing system. GNU Screen, introduced in 1987, emulated multiple VT100 sessions on a single terminal, transforming remote and local shell workflows.

Getting Started

To launch a new Screen session:
Press Space or Enter to dismiss the welcome message. Behind the scenes, Screen has created session 0 and window 0, presenting you with a familiar shell prompt.

Prefix & Window Management

All Screen commands begin with the default prefix: Ctrl-a (denoted C-a), followed by a command key.

Example: Managing Windows

  1. In window 0, run:
  2. Press C-a c to create window 1, then run ps again.
  3. Press C-a w to view the window list:
  4. Rename window 1:
    • Press C-a A
    • Enter ps
  5. Create window 2 named “yetanotherwindow”:

Switching Windows After C-a ", use ↑/↓ and Enter:
Closing Windows
  • Exit the shell/program inside the window
  • Or press C-a k, then confirm with y:
When the last window closes, the Screen session terminates automatically.

Splitting into Regions (Panes)

Divide your window into multiple regions for side-by-side workflows.
Empty regions display as two hyphens. Closing a region does not kill its window; it simply hides the view.

Sessions: Listing, Naming & Killing

Listing Active Sessions

  • 1037: Session PID
  • pts-0.debian: Terminal and host

Naming a New Session

Now screen -ls shows:

Killing a Session

You can use the session name instead of the PID.

Detaching & Reattaching

Use man screen for the complete list of attach/detach options: https://man7.org/linux/man-pages/man1/screen.1.html

Copy/Scrollback Mode

Screen’s scrollback mode allows you to browse history and copy text across windows:
  1. Enter mode: C-a [
  2. Move cursor to the start of the text (arrow keys)
  3. Press Space to begin selection
  4. Move to the end of the text
  5. Press Space to complete selection
  6. Paste with: C-a ]
The image shows instructions for using GNU Screen's scrollback mode, detailing key combinations for entering scrollback mode, moving to text, and marking the beginning and end of a selection.

Configuration

Screen reads two primary config files: Each config file may include:
  1. General settings
  2. Key bindings
  3. Terminal settings
  4. Startup screens
Edit these files to tailor Screen’s behavior. Consult the GNU Screen man page for a full directive reference.

Watch Video