Skip to content

testifysec/tmuxviewer

Repository files navigation

TMux Viewer

A web-based viewer for tmux sessions with real-time updates, ANSI color support, and process metadata tracking.

Features

  • 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

Prerequisites

  • Go 1.19 or higher
  • tmux installed and running
  • Modern web browser with WebAssembly support

Installation

git clone https://github.com/testifysec/tmuxviewer.git
cd tmuxviewer
make build-all

Usage

  1. Start the server:
./tmuxviewer --addr :8080

Or run it in a tmux session (recommended):

tmux new-session -d -s tmuxviewer './tmuxviewer --addr :8080'
  1. Open your browser and navigate to http://localhost:8080

  2. Click on any tmux session in the sidebar to view its content

Development

Building

# 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

Project Structure

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

Features in Detail

ANSI Color Support

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.)

Process Tracking

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

Multi-Window View

  • Tab View: Traditional single-window view
  • Grid View: Automatic grid layout for multiple windows
  • Multi View: Select specific windows to display with customizable layout

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A web-based viewer for tmux sessions with ANSI color support

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages