GNU screen
is a terminal multiplexer. meaning it can create multiple virtual sessions from within a single terminal session. Using a terminal multiplexer also allows you to persist sessions after a terminal window is closed, create multiple windows for building more efficient workflows, and collaborate with other people working on the same servers as you.
All shortcuts are case-sensitive. i.e. ctrl+a S != ctrl+a s
(ctrl+a S == ctrl+a <shift> s
).
For all shortcuts, release ctrl+a
before hitting next key.
screen
or
screen -S "name_of_session"
From within a screen session: ctrl+a d
screen -ls
screen -r
or
screen -r "name_of_session"
ctrl+a c
ctrl+a "
You can select a window from this menu using arrow keys or 'j' and 'k', then return.
ctrl+a n
where n is a window number
ctrl+a S
note: capital S
another note: newly initialized regions will be empty. you can use the next step to move into the new region. From there, you can use previous steps to either create a new window (ctl+a c
) or select an existing window (ctl+a n or ctl+a "
)
note: vertical splitting is only available on screen
versions >4.01, macOS is still on 4.0.0. you can update to a more recent version with brew install screen
.
ctrl+a |
note: pipe
ctrl+a tab
From region to close: ctrl+a X