There are a great many ways to available to run multiple shell applications at the same time, from within the same shell instance.
These are typically known as terminal multiplexers — with tmux and GNU Screen being among the most popular. Both of which allow you to divide up the shell screen into a grid pattern, with each application taking up a portion of that grid.
Well, there’s a new kid on the block that does things… a little bit differently.
How it works:
You launch mprocs with a list of applications or shell commands you wish to run (with each as a command line parameter).
mprocs nano sh sh
Will result in:
You then type “Control-A” to switch focus between the “Processes” list on the left and the currently running shell process (on the right).
When the “Processes” list has focus, you can then hit a key to control that individually selected process:
Arrow up/down (or J/K) — Move between each process.
X — Stop running the process.
S — Start running the process again (if it was stopped).
Q — Quit mprocs entirely.
In this way, the Processes list in mprocs is, essentially a task manager / system monitor / task switcher.
Want one of the processes to be a server or application you are testing — and another to be an IDE, text editor, or compiler process? Start, stop, and re-start them at well. Very handy for making and testing builds or configuration changes.
I’ve been using mprocs all morning and it works astoundingly well. Honestly, I could see this quickly becoming my favorite way to run multiple terminal applications inside a single shell (which is very handy when SSHing into a server).
There are only two downsides that I’ve found for mprocs thus far:
- The “Control-A” hotkey for switching focus can conflict with some applications. It would be nice if this was easily configurable.
- There is no way to add an additional running process once mprocs is running. However many processes you start mprocs with… that’s how many you get until you quit mprocs and start again.
That second one is the biggest issue… though there is a (less than ideal) workaround:
Add as many shell sessions (with no processes running) as you think you might want to use. For example:
mprocs sh sh sh sh sh
Will start mprocs with 5 shells… from there you can launch any shell application you like (vim, nano, htop, etc.).
All-in-all, I like mprocs quite a lot! Considering it is a new project — and the fact that I only have two issues (ones which seem rather straight forward to resolve) to complain about — I am darned impressed!
I highly recommend grabbing a release from the GitHub page and taking it for a spin.