To start multiple sessions automatically, set up a .screenrc
file, a config file for screen. In it, you can create sessions, start programs, change the working dir etc. I use it to initialise my screen session.
Simple exampe for a .screenrc file:
# don't display the copyright page
startup_message off
# increase scrollback buffer size
defscrollback 10000
# create windows
screen -t TODO vim TODO.txt
chdir src
screen -t coding vim main.c
screen -t run
The screen
commands above each create one screen session. -t
sets the session's title; the rest of the line is the command to run and its parameters.
Thus, the first and second screen
line start a session and launch vim
inside. The third one just starts a session and drops you at a prompt. chdir
changes the working directory for all subsequent sessions.
If you want to have multiple .screenrc
files, just name them any way you want, and select one with screen -c myscreenrc
.