0

In screen, you can press ctrl+a c to create new terminal inside the same screen session. Now I have to automate this activity and do the same from my bash script:

dbus-launch screen
finch
ctrl+a c <--------- HOW TO CHANGE THAT LINE?
python myscript

Any hints?

mnowotka
  • 16,430
  • 18
  • 88
  • 134

1 Answers1

0
screen -S <session> -X screen <command to run in the new window>

You should add the session tag when you first create the screen session.

Example:

# Create screen session named myscreen and detach.
dbus-launch screen -S myscreen -d -m
# Do something
# ...
# Create a new screen window and launch python on it.
screen -S myscreen -X screen python -v
mvillar
  • 472
  • 3
  • 14