Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two programs A and B. I want a single command, which will run Program A and Program B in two different terminals but in the same tab, i.e, in a horizontally split terminal. I know screen can do that but I have to manually enter C-a S, C-a tab, C-a c to invoke, switch and run the programs. If I want to do so in a single command, is it possible?

share|improve this question

migrated from Dec 9 '12 at 11:13

This question came from our site for professional and enthusiast programmers.

You can set up a simple .screenrc file to automatically create the sub-windows and execute the commands for you. – twalberg Dec 6 '12 at 21:42
you could use Terminator terminal which supports split shells in the same tab, and sending keystrokes to multiple split shells at the same time – Alex Dec 6 '12 at 22:14
@twalberg I know about the .screenrc file. But I don't know the command to do so. Could you please provide a sample for the same? – Nehal J. Wani Dec 7 '12 at 10:39
up vote 2 down vote accepted

A simple .screenrc to accomplish this might look something like this:

# whatever other normal entries you have for options and other configuration
sessionname some_descriptive_name
screen 0 first_command
focus down
screen 1 second_command

That splits the screen vertically, though... Not sure how to split horizontally, but I'll update later if I figure it out...

Edit: use split -v to split horizontally (the split line is vertical, so you have left/right instead of top/bottom).

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .