Make GNU screen survive reboot
There is no way to save a screen session in the fashion that you desire. What I did was the next best thing: scripted autossh to connect to my servers and set up my rig the way I like it.
Love it.
Local connection down, I wait, it comes back up and there's my work ( I use nested screens ). Server down or rebooted, I wait, and am back in my default position. This gives me the feeling of continuity that I desired.
Anyway, I asked this exact question years ago on the screen list.
Summary: Seek not eternal life for screen. Instead learn to resurrect.
This is the meat of the .screenrc config:
There is an example, rscreen, in the autossh package that I modified into the econnect program.
The --esc parameter is to set the remote screen escape to something different ( my escape is `)
#add much much more scrollback
defscrollback 10000
# make some default windows
screen -t ADMIN 1
chdir /Users/chiggsy/Sites/
screen -t SITES 2
chdir /Users/chiggsy/src/
screen -t SRC 3
chdir
screen -t FERGUS 4 /Users/chiggsy/bin/econnect --host host.example.com --port 50000 --esc g --user sol
screen -t LAEG 5 /Users/chiggsy/bin/econnect --host host.example2.com --port 505000 --esc g --user invictus
screen -t ROOT 0 sudo su -m
See: http://skoneka.github.io/screen-session/
Available screen-session modes:
----
save - save Screen ( and VIM ) session
load - load session
ls - list saved sessions
----
dump - print detailed informations about windows in the session
group - move windows to a group
layoutlist - display a list of layouts
layout-checkpoint - record a snapshot of the current layout.
layout-history - display saved snapshots of the current layout
layout-redo - load a snapshot of the current layout,
layout-undo - load a snapshot of the current layout,
layout-zoom - zoom into and out of a region
kill - send SIGTERM to last the process started in a window
kill-zombie - kill all zombie windows in the session
kill-group - recursively kill all windows in a group
manager - sessions manager (screenie like) but featuring session
preview in a split window
nest-layout - copy a layout to the current region
new-window - start a new Screen window in the same working directory
on the position next to the current window
name - get or set the sessionname
regions - display a number in every region (like tmux display-panes)
renumber - renumber windows to fill gaps
subwindows - recursively print windows contained in groups