13

I know it's possible, but I can't for the life of me figure out how, to launch screen with one window in split region mode?

ie: I have screen set to open multiple windows on launch, but want window 0 to be split into two regions with an application running in each region

1 Answer 1

15

You could add the split command to your .screenrc and use focus and select to control which window is in which split and which split is focused:

screen -t window0 bash
screen -t window1 bash
select window0
split
focus down
select window1
focus up

Note that splitting does not split individual screen windows but instead creates a split for the entire instance of the screen session. Also, reattaching the screen session after its creation will not recreate the split.

If you wanted just the first screen window split into multiple regions you could run another screen session within the first window of your screen session and use the above screen settings for it. If you save the above settings in a file other than .screenrc, for example .screenrc.split, you could add this to your main screen session to start an embedded split screen within a screen window:

screen -t split screen -S split -c .screenrc.split

If you embed a screen session within your main screen session, you will want to bind the command escape key to something besides CTRL+A for your inner screen session. To bind this key to CTRL+B add this to the screen configuration file for the embedded screen (.screenrc.split):

escape ^Bb
1
  • Thanks! I did not ask the question but always wanted to be able to do this. Very nice!
    – Oscar
    Aug 4, 2010 at 9:13

You must log in to answer this question.