Mprocs - running multiple shell applications in one console

Posted by Adam Aciek Paszkiewicz on nie 29 maja 2022 Updated on nie 29 maja 2022 Translations: pl

Mprocs - a cool way to run multiple shell applications in one console

While searching the internet looking for something interesting, I completely accidentally came across a very nice project, which was written in Rust - that is, in a fairly young language, although this article is not about programming. The project is called mprocs and in my opinion it is definitely worth your attention. What is mprocs for? Main idea of mprocs I already included in the topic but maybe I will develop it a bit.

The purpose of mprocs is to allow commands to be run in parallel in one shell so that you can easy switch between them and in a really simple way with a great presentation of this in the console. You have to see for yourself as it look like in real

mprocs

Maybe in short words I will describe what I launched here, which will show the possibilities offered by mprocs and how it improves our work, and by the way I will show you how to move between the panes and what functions we have at our disposal for the running processes.

To begin with, I will run the processes that interest me for the purposes of this article. I want to run several processes at the same time:

  • bash - here I will have fun in Vim while writing this article
  • pelikan -r -l - servers where I watch what I write after generating the blog
  • atop - system and process monitoring
  • htop - another system and process monitor
  • pelican content - generating the entire blog

And how to do it? Just execute the command:

mprocs  bash "pelican -r -l" atop htop "pelican content"

In the left part of the console there is a list of processes and in the right part the terminal.

mprocs

Switching between the Processes pane and the Terminal pane is very easy because all you need to do is use a key combination:

control + a

Anyway, the most important things we can do and how to navigate are listed at the bottom of the mprogs screen in the Help section.

mprocs

In our case, as you can see, pelican content is in Down status because when progs was started, the content was generated and the process stopped. If you want to restart it, you just need to set to pelican content and press the s key. For a moment the process will be set to Up status, and when finished, it will go back to Down. It's simple, isn't it?

For the sake of order, let's list all the available options (including those not listed in Help):

  • Control + a - switching between Processes and Terminal
  • q - exit from the program (soft)
  • Q - exit from the program (force kill)
  • j - next
  • k - previous
  • s - start
  • x - stop (soft kill)
  • X - stop (hard kill)
  • r - restart (soft kill)
  • R - restart (hard kill)
  • Control + d - scroll down
  • Control + u - scroll up

Of course, you can also navigate through the processes using arrows, and in the case of a large list, page up, page down. At the end, maybe I will add two more things.

  1. Mprogs allows you to create a json that will contain what processes with what attributes are to be launched by default, then you do not need to enter them as attributes. A detailed description can be found on the project website mprocs
  2. Mprogs can run on many operating systems so both Windows and Mac or Linux fans can use it. I personally installed the application via cargo that is the Rust package manager, but if someone wants to do it in a different way, have a look here

For me personally - although I just got to know this tool - I liked mprocs very much and as you can see on an example from real life it can be useful, so applause for the author :)

Ave :)