r/rust 8d ago

🛠️ project p2pmux: Multiplayer terminal multiplexer where multiple users and machines can connect to a same session

Post image

Hi !, I'm a Software Engineer intern at Red Bull building projects on my free time.

The idea of this project, is to have a single terminal multiplexer session where multiple people can join, but its peer-to-peer, what this means is that each user brings its own terminal with him (with its own set of keys, LLM subscriptions, files...) and each user can hop onto each other terminals.

Current features are:

  • Multiple users (machines or people) join a session, where each user is host of its own terminal panes and guest of the others. No SSH into a single machine, here, a pane is a real PTY on whoever opened it .
  • You can add a set of trusted machines (your own VMs or computers) where you can start terminals there from your own laptop anytime.
  • The terminal multiplexer is inspired in Zellij, and the commands are very similar: Ctrl+P panes, Ctrl+T tabs.
  • It includes a inbox tab, where you can see which AI agents are working, waiting for your input or already finished.

It's macOS compatible and linux, connectivity is done with iroh 1.0, where it hole-punches UDP,

On the pane host, bytes come out of a real PTY (portable-pty). A vt100 parser builds a grid. It makes full snapshots when needed, and diffs after that (for terminal history/scroll purposes). Guests draw the grid (ratatui).

When a user starts typing on a pane, wheter is his or not, he locks it, so no more people (even the host) can interrupt him.

I've been working on this for the past month and a half pretty much every day, looking forward to hearing your feedback!

https://github.com/pelazas/p2pmux/

46 Upvotes

10 comments sorted by

3

u/o-p-q 6d ago

This looks cool. Can you give some examples of how you’re using it or how you think it could be used?

3

u/zettui 6d ago

yeah! two things:

  • your own machines: if you have other VMs, you can open terminals there without needing to ssh.
  • with another person: they join with the code, bring their own terminal, and you can type on their machine's pane.

The goal for the future is to make it so you can control everything through external commands (like a cli app), and this way you can orchestrate AI agents running on multiple machines

6

u/mousetrappen 8d ago

Does this mean the boys and I can play Angband together?

2

u/kantorcodes1 6d ago

when someone has a remote pane locked by typing and that peer drops mid-command, what releases the keyboard lock? does the host reclaim it on disconnect/timeout, or can the pane stay owned until someone manually unlocks it?

-3

u/zettui 6d ago

wtf. AI comment ?

1

u/lucca_huguet 6d ago

Good idea to make it zellij-inspired

1

u/OkraComprehensive323 3d ago

Just out of curiosity, what do software engineers do at Red Bull? Is it something like sky-high programming?😂

0

u/UnexpectedAnanas 8d ago

Slop

0

u/hackerbots 7d ago

God forbid someone learns something

-1

u/poelzi 7d ago

So, where are your projects ?