Start a few programs in a split terminal

1

I want to start a few programs with a single launch script and monitor their outputs to the console.

The easiest way would be to launch in background an xterm for each program, but that's not very neat (I don't like having too many windows around).

The other alternative I've thought of is to redirect their outputs to logfiles and then use multitail to watch their outputs in a single terminal, but if I want to kill them I'd need to take a look at their PID's and then issue a kill command rather than just going to their terminal and press Ctrl+C. Also, this wouldn't work well if some of the program uses curses or similar.

My ideal option would be something like using screen to multiplex a terminal (or even show all of them in a split fashion), but I cannot find any option in the manual pages related with that and googling screen won't throw any useful result as it is a very generic term.

So, any suggestions on how to achieve something similar to what I want?

fortran

Posted 2012-06-22T13:00:35.613

Reputation: 113

Answers

1

No suggestion for your specific problem but have you also considered tmux which is said to be easier to configure. Have a look at this and this blog post for more information and some advantages compared to screen.

pgras

Posted 2012-06-22T13:00:35.613

Reputation: 314

0

It is possible to do this with screen by loading a custom screen configuration file. Here is an example for starting and monitoring four programs in a split terminal. Create a file launch_file somewhere with the following in it:

split
split
split
screen program1
focus down
screen program2
focus down
screen program3
focus down
screen program4

where program1, program2... are the four programs you wish to run. Now, in a (large) xterm or similar enter screen -c launch_file. You should see a four-way split view with one of the programs running in in each. You can use Ctrl+a tab to cycle through the four windows, and use Ctrl+c to stop one of the programs.

simonb

Posted 2012-06-22T13:00:35.613

Reputation: 208