Multiple Terminals
Termbridge can run multiple terminal sessions simultaneously. One server hosts several tmux sessions, and the UI lets you switch between them.
How it works
- Termbridge tracks sessions it created or attached to in the current run
- The terminal switcher shows all available sessions
- Switching is instant - no reconnection needed
Creating multiple sessions
On startup
Use the TERMBRIDGE_SESSIONS environment variable:
TERMBRIDGE_SESSIONS=3 npx termbridgeThis creates three sessions: <base>, <base>-2, and <base>-3.
During development
Use the shortcut script:
bun run dev:beam:multiFrom the UI
- Tap the terminal icon in the bottom bar
- Tap "New Terminal" in the switcher
- A new session is created and selected
Switching terminals
- Tap the terminal icon in the bottom bar
- A list of available sessions appears
- Tap one to switch
The switch is instant - your previous session keeps running in the background.
Use cases
Build + logs
Run your build in one terminal, tail logs in another:
# Terminal 1: Build
npm run build
# Terminal 2: Logs
tail -f logs/app.logSwitch between them without losing your place.
Server + client
Run your backend server in one terminal, frontend dev server in another:
# Terminal 1: Backend
npm run server
# Terminal 2: Frontend
npm run devMultiple SSH sessions
Connect to different servers:
# Terminal 1
ssh user@server1.com
# Terminal 2
ssh user@server2.comMonitor both from your phone.
Session naming
By default, sessions are named based on the port number. Use --session for meaningful names:
termbridge --session api-serverWhen creating multiple sessions with TERMBRIDGE_SESSIONS, the base name is used with numeric suffixes.
Persistence
- Sessions persist when you disconnect from the UI
- Sessions persist when Termbridge restarts (unless
--kill-on-exit) - Use
--session <name>to reconnect to an existing session