Skip to Content

How to run multiple shell applications in one shell on Linux, Mac, and Windows using mprocs

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.

Enter: mprocs

How to run multiple shell applications in one shell on Linux, Mac, and Windows using mprocs

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).

For example: mprocs nano sh sh

Will result in:

You launch mprocs with a list of applications or shell commands you wish to run (with each as a command line parameter).

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).

I could see this quickly becoming my favorite way to run multiple terminal applications inside a single shell.

There are only two downsides that I’ve found for mprocs thus far:

  1. The “Control-A” hotkey for switching focus can conflict with some applications. It would be nice if this was easily configurable.
  2. 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.

Alex Lim is a certified IT Technical Support Architect with over 15 years of experience in designing, implementing, and troubleshooting complex IT systems and networks. He has worked for leading IT companies, such as Microsoft, IBM, and Cisco, providing technical support and solutions to clients across various industries and sectors. Alex has a bachelor’s degree in computer science from the National University of Singapore and a master’s degree in information security from the Massachusetts Institute of Technology. He is also the author of several best-selling books on IT technical support, such as The IT Technical Support Handbook and Troubleshooting IT Systems and Networks. Alex lives in Bandar, Johore, Malaysia with his wife and two chilrdren. You can reach him at [email protected] or follow him on Website | Twitter | Facebook

    Ads Blocker Image Powered by Code Help Pro

    Your Support Matters...

    We run an independent site that is committed to delivering valuable content, but it comes with its challenges. Many of our readers use ad blockers, causing our advertising revenue to decline. Unlike some websites, we have not implemented paywalls to restrict access. Your support can make a significant difference. If you find this website useful and choose to support us, it would greatly secure our future. We appreciate your help. If you are currently using an ad blocker, please consider disabling it for our site. Thank you for your understanding and support.