Add support for terminal sessions
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
I like the usecase. I'll be moving towards having this feature, but it will require some work to switch to client-server architecture.
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
I understood you, it conflicts the main concept of mprocs. Thanks for the answer :)
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)