Link to home
Create AccountLog in
Avatar of ResultsGen
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

Hi,

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 http://www.slashdot.org/
screen -t k5 4 lynx http://www.kuro5hin.org/
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

http://www.softpanorama.org/Utilities/Screen/screenrc_examples.shtml

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

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

ASKER