A web-based viewer for tmux sessions with real-time updates, ANSI color support, and process metadata tracking.
- Real-time Session Monitoring: View all your tmux sessions, windows, and panes in a web interface
- ANSI Color Support: Full support for ANSI escape sequences including 256 colors and styling
- Process Metadata: Track which process generated each line of output with PID and command information
- Multi-Window View: Select and view multiple tmux windows simultaneously with various layout options
- Search and Filter: Search through terminal output and filter by process name
- Scroll Lock: Lock scrolling to the bottom to follow new output
- TMux Server Status: Monitor tmux server status and handle restarts gracefully
- Historical Data: Load and view scrollback buffer from tmux panes
- Go 1.19 or higher
- tmux installed and running
- Modern web browser with WebAssembly support
git clone https://github.com/testifysec/tmuxviewer.git
cd tmuxviewer
make build-all
- Start the server:
./tmuxviewer --addr :8080
Or run it in a tmux session (recommended):
tmux new-session -d -s tmuxviewer './tmuxviewer --addr :8080'
-
Open your browser and navigate to
http://localhost:8080
-
Click on any tmux session in the sidebar to view its content
# Build everything
make build-all
# Build only the WebAssembly frontend
make build-wasm
# Build only the backend server
make build-backend
# Run in development mode
make run
tmuxviewer/
├── main.go # Entry point
├── server.go # WebSocket server
├── hub.go # WebSocket hub for client management
├── tmux/ # TMux interaction layer
│ ├── client.go # TMux command interface
│ └── session.go # Session management
├── frontend/ # WebAssembly frontend
│ ├── main.go # Frontend entry point
│ ├── ui.go # UI management
│ ├── websocket.go # WebSocket client
│ └── terminal/ # Terminal rendering
│ ├── ansi.go # ANSI escape sequence parser
│ ├── buffer.go # Terminal buffer
│ └── domrenderer.go # DOM-based renderer
├── shared/ # Shared types
│ └── protocol.go # Message protocol definitions
└── static/ # Static web assets
├── index.html
└── style.css
The viewer includes a comprehensive ANSI escape sequence parser that supports:
- Basic 16 colors (foreground and background)
- Bright color variants
- 256-color palette
- RGB true color
- Text attributes (bold, italic, underline, etc.)
Each line of output is tagged with metadata about the process that generated it:
- Process ID (PID)
- Command name with full arguments
- Working directory
- Timestamp
- Tab View: Traditional single-window view
- Grid View: Automatic grid layout for multiple windows
- Multi View: Select specific windows to display with customizable layout
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.