mprocs icon indicating copy to clipboard operation
mprocs copied to clipboard

Add support for terminal sessions

Open sashachabin opened this issue 4 years ago • 4 comments

Thanks for creating an alternative to tmux for Windows! This helps a lot when working over SSH with Windows (especially for older versions without WSL).

My problem

Sometimes SSH-connection and access to terminals get lost. In order to have access to the output from the terminal, I have to constantly search and kill these processes, and then restart them.

Feature request

I would like to offer a feature for creating new sessions and connecting to them.
I suggest adding the following commands, as it is done in tmux:

# Create new session with name "test"
tmux new -s test

# List of sessions
tmux ls

# Connect to last session
tmux attach 

# Connect to session with name "test"
tmux attach -t test  

# Kill all sessions
tmux kill-server

sashachabin avatar Aug 31 '21 10:08 sashachabin

I like the usecase. I'll be moving towards having this feature, but it will require some work to switch to client-server architecture.

pvolok avatar Aug 31 '21 12:08 pvolok

I checked what would it take to implement this feature. It would require client-server architecture, which would complicate the code a lot and would not be useful to the primary goal of mprocs — just running multiple processes.

There are two alternatives I can think of:

  • PM2: https://pm2.keymetrics.io/docs/usage/quick-start/
  • tmux on cygwin: https://cygwin.com/packages/summary/tmux-src.html

pvolok avatar May 07 '22 05:05 pvolok

I understood you, it conflicts the main concept of mprocs. Thanks for the answer :)

sashachabin avatar Jun 09 '22 16:06 sashachabin

I am reopening this issue because mprocs will support client-server mode. Internally the architecture is already changed to support this.

Some issues still need to be solved:

  • User cli api design (attach, cli control)
  • Multi-version handling (project local mprocs from npm is running the project, os global mprocs is trying to connect to it)
  • Discovery (how do we discover all sessions currently running)

pvolok avatar Aug 03 '25 07:08 pvolok