Skip to content

eddiexux/termgrid

termgrid

Crates.io CI License

A terminal multiplexer with Git context awareness, built in Rust.

Manage multiple terminal sessions in a single dashboard. Each tile automatically detects Git project, branch, and worktree — letting you see at a glance what's running where.

中文文档

termgrid screenshot

Features

  • Multi-terminal grid — 1/2/3 column layout with tile cards showing live terminal preview
  • Git context awareness — auto-detect project name, branch, worktree per tile
  • Project grouping — tab bar groups tiles by Git project, click to filter
  • Detail panel — select a tile to see full terminal output with colors
  • Mouse-driven UI — all actions via clickable toolbar buttons, no modal switching
  • Scroll lock — detail panel stays in place when scrolled back, new output won't reset your position
  • tmux backend — automatic tmux integration when available, sessions survive termgrid restarts
  • Claude Code awareness — detects Claude Code tiles, shows unread notification on task completion
  • Session persistence — auto-save/restore tile layout on restart; tmux sessions reconnect automatically
  • Mouse support — click to select tiles, drag to select text (auto-copy to clipboard)
  • Full terminal emulation — powered by vt100, supports complex TUI apps
  • CJK support — correct wide character rendering
  • Logging — debug logs to ~/.local/share/termgrid/termgrid.log

Installation

Homebrew (macOS)

brew tap eddiexux/tap
brew install termgrid

Note: You need to create a homebrew-tap repo on GitHub first and publish the formula from packaging/homebrew/termgrid.rb to Formula/termgrid.rb in that repo.

From crates.io

cargo install termgrid

Update to latest version

cargo install termgrid --force

From source (latest dev)

cargo install --git https://github.com/eddiexux/termgrid.git

Build locally

git clone https://github.com/eddiexux/termgrid.git
cd termgrid
cargo build --release
# Binary at target/release/termgrid

Usage

termgrid                # Start with saved session (or empty dashboard)
termgrid ~/projects     # Open a tile in the given directory
termgrid --fresh        # Ignore saved session, start empty

Mouse-driven UI

All actions are performed via toolbar buttons — no keyboard shortcuts needed in the main interface. Click a tile to select it, and your keyboard input goes directly to that terminal.

Top bar (tab bar)

Button Action
Tab labels Click to switch project filter
[+] New tile
[X] Quit app

Bottom bar (status bar)

Button Action
[?] Show help
[×] Close selected tile
[Ncol] Cycle columns (1 → 2 → 3 → 1)

Mouse actions

  • Click tile card to select — keyboard input goes to that terminal
  • Drag in detail panel to select text (auto-copies to clipboard on release)
  • Scroll wheel on grid to navigate tiles, on detail panel to scroll history

Configuration

Optional config at ~/.config/termgrid/config.toml:

[layout]
default_columns = 2          # 1, 2, or 3
detail_panel_width = 45      # percentage

[scan]
root_dirs = ["~/workplace"]  # project scanner roots
scan_depth = 2

[terminal]
shell = "/bin/zsh"
cwd_poll_interval = 2        # seconds

Platform Support

  • macOS — full support (CWD tracking via proc_pidinfo)
  • Linux — planned (CWD tracking via /proc)
  • Windows — not planned

Architecture

termgrid
├── App            — event loop + mouse-driven state management
├── EventLoop      — tokio-driven, multiplexes PTY output + input + timers
├── TileManager    — tile lifecycle, selection, grid navigation
│   └── Tile       — PTY backend + vt100 terminal emulator + Git context
├── PtyBackend     — trait with two implementations:
│   ├── PtyHandle  — native PTY (portable-pty)
│   └── TmuxPtyBackend — tmux session with pipe-pane I/O
├── GitDetector    — CWD change → git2 repo detection (with debounce)
├── TabBar         — dynamic project grouping from tile Git contexts
├── Layout         — multi-column grid + detail panel calculation
└── UI             — ratatui widgets (tile card, detail panel, tab bar, overlays)

Tech Stack

Component Crate
TUI framework ratatui + crossterm
Terminal emulation vt100
PTY management portable-pty + tmux
Git detection git2
Async runtime tokio

License

Licensed under either of

at your option.

Contributing

See CONTRIBUTING.md for guidelines.

About

No description, website, or topics provided.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors