Link to home
Create AccountLog in
Avatar of ResultsGen

asked on

Command to cause screen to recover a session as it was configured (w/ splits)

I'm a frequent user of screen, I usually do a few splits and run multiple sessions with 3 or 4 panes.  When I lose my connection and do a screen -RR to re-attach it just re-attaches to one of the splits, not the whole session.  I have to manually do two or three splits with ^A:next to get it back to where it was.

How can I issue a single command to recover the configuration?
Avatar of Steve Tempest
Steve Tempest
Flag of Australia image


Have a look into your ~/.screenrc file I believe you can achieve what your after.

# Example of automatically running some programs in windows on screen startup.
# Use the form: screen [-flag] [window name] [window number] [program to run in window]
# The -t flag means that the window in which that program is running
# closes when you exit that program, so if you quit pine
# window 2 closes.

screen bash
screen -t emacs 1 emacs
screen -t mail 2 pine
screen -t slashdot 3 lynx
screen -t k5 4 lynx
screen -t bar 5 ssh foo@bar

# I cribbed most of this from /etc/screenrc
# Check it out on your own to learn more about keybindings and whatnot.

Also have a look at this page for some examples

It goes into the Master and Slave splits.
Avatar of ResultsGen

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of ResultsGen