I'm trying to figure out how to create a command called runbg that will accept sub-commands to run in the background, and create a split screen for each sub-command, when a sub-command completes the split screen is closed, if a sub-command fails then the screen stays open with the error until the user closes the screen with the terminate signal, once all screens are closed, the command is complete and execution continues. E.g.runbg ping -t 5 google.com ping -t 10 microsoft.comecho doneI've discovered I can do do:ping -t 5 google.com &ping -t 10 microsoft.com &waitWhich accomplishes the parallel side of things, however each command outputs everything to the same terminal, which is very noisey. Hence the desire for a split screen setup.From searching here, I've discovered GNU Screen which seems to handle the screen side of things, but it seems it requires a .screenrc file - which while possible to do programmatically, is a bit annoying (as I'd imagine it would mean I would need to write a random tmp file somewhere)I found this answer which goes into using screen without the .sreenrc however I cannot figure out how to do the split screen stuff in it.So in short:Is there something that already does the functionality that I'm aiming for with runbg?If not, is GNU Screen what I want for this? Do I need to use a .screenrc file, or is there a way to accomplish the split screens without one?
Programatically run background tasks in a split screen?
gnu screen
You can do it with tmux by stringing together split-window and send-keys like this:tmux new session \; split-window -v \; send-keys 'ping -t 5 google.com' C-m \; split-window -h \; send-keys 'ping -t 10 microsoft.com' C-m \;