I've just installed tmate and tmate-slave on a VM and am wondering if when more than one user is part of the session, can tmate allow both users to work in synchronous mode, meaning each has their own tmate pane and is issuing commands separately (of course using the session owner's account)?

I've googled but cannot find an answer to this, nor can I find whether this setting is in the docs of tmate, or of tmate-slave. If anyone knows if this is even possible please let me know.

The closest question I've found relates to tmux and since tmate is a fork is this feature automatically included in tmate?

  • 1
    This post is 2 years old, is the only post about this issue I could find and still had no answer. Sorry to do archaeology here but did you find a solution for your issue? If yes, can you share the answer? – Ivaprag Sep 21 '17 at 12:09
  • @Ivaprag Nope, I still have not found a solutions to this. Would be nice tough. I've not used tmate in a while now. When I pick it back up again, and I dig into it I will update the question. Sorry. – rivanov Sep 21 '17 at 20:51

No, this is not possible due to the way tmate (and similar programs, such as GNU Screen) work.

All tmate I/O goes through a pseudo-tty, or "pty." This has two sides to it, which I will call the user side and process side. * The process side has three data streams (sequences of bytes): it sends data to the stdin of the process and reads data from the stdout and stderr of the process. * The user side has two data streams: it reads input from the user (e.g. what he types), which is then sent to the process side stdin stream, and writes data to the user, which is a mix of everything read from the process side stdout and stderr.

What tmate does is add an extra layer in front of the pty which takes all bytes output from the user side of the pty and sends a copy of each byte to each tmate client, and reads all input from all the clients and sends it, intermixed, to the pty.

From this you can see that on the process side of the pty the process reading from stdin (bash, vim, or whatever) has no way of knowing which client sent any particular byte, or even that there are multiple clients (or any clients at all). Thus, there is no way for that process, which is generating the "cursor" for that session, to have multiple cursors.

If you want users to be issuing commands separately, they need to be sending them to separate shell processes, which means separate tmate sessions.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.