Brian Krabach 26e2baa89c fix: close stale WebSocket on session switch to prevent double output and crash loop
Before: openTerminal() never closed the previous WebSocket. After A→B→A,
two WS connections to session A both wrote to _term → double keystroke echoes.
Rapid switches triggered a CONNECTING-state send error and reconnect loop.

After: openTerminal() nulls _currentSession, clears reconnect timer, and
closes _ws before opening a new connection. connect() event handlers now
capture the WS instance in a local const and check 'ws !== _ws' on entry
so stale connections silently ignore all events.

Tests: three new regression tests verify:
- openTerminal() calls close() on the previous WS (Bug 1)
- stale open handler does not send on new WS after switch (Bug 2)
- stale close handler does not schedule reconnect after switch (Bug 2)
2026-03-28 01:25:29 -07:00

muxplex

A web-based dashboard for tmux sessions. Access and manage all your tmux sessions from any device — browser, phone, tablet.

Features

  • Live tile grid showing all running tmux sessions
  • Click any session to open a full interactive terminal
  • Bell/activity notifications across sessions
  • Multi-device support with state sync
  • Mobile-friendly, responsive, PWA-capable
  • Works over Tailscale private network

Stack

  • Backend: Python FastAPI coordinator (coordinator/)
  • Frontend: Vanilla JS + xterm.js (frontend/)
  • Terminal: ttyd (WebSocket bridge to tmux)
  • Proxy: Caddy

Running

# Install dependencies
pip install -r requirements.txt

# Start coordinator (from this directory)
python -m uvicorn coordinator.main:app --host 0.0.0.0 --port 8099

# Start Caddy proxy
caddy run --config Caddyfile

Development

# Run tests
python -m pytest

Brand assets

Design language, tokens, and brand assets in assets/branding/. To regenerate PNG/favicon assets from SVG sources:

python3 scripts/render-brand-assets.py
S
Description
Web-based tmux session dashboard and terminal multiplexer
Readme 4.4 MiB
Languages
Python 63.1%
JavaScript 30.5%
CSS 4%
HTML 1.4%
Go 1%