Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Environment:AI Builder Club Skills tmux

From Leeroopedia
Knowledge Sources
Domains Developer_Tooling, Terminal_Multiplexing
Last Updated 2026-10-24 00:00 GMT

Overview

tmux terminal multiplexer environment for managing long-lived dev server processes in detached sessions with per-service windows.

Description

This environment provides the tmux terminal multiplexer, which manages a named session containing one window per long-lived dev server. Each window runs a server process in the background, allowing the developer to attach, view logs, restart individual windows, and check port status — all without blocking the main terminal. The dev-local.sh template uses tmux's session/window model for idempotent server lifecycle management.

Usage

Use this environment for Dev Stack Automation — the dev-local.sh script requires tmux to manage multiple dev servers (web, API, etc.) in separate windows within a single named session. Required by the dev_local_template_sh implementation.

System Requirements

Category Requirement Notes
OS macOS, Linux Not natively available on Windows (use WSL2)
Hardware Any No special hardware needed
Disk 10MB tmux binary

Dependencies

System Packages

  • tmux >= 3.0
  • lsof (for port checking)

Python Packages

  • None

Credentials

No credentials required.

Quick Install

# macOS
brew install tmux

# Ubuntu/Debian
sudo apt install tmux

# Verify
tmux -V

Code Evidence

Preflight check from dev-local.template.sh:51:

command -v tmux >/dev/null 2>&1 || die "tmux not found. Install: brew install tmux"

Session creation from dev-local.template.sh:96:

tmux has-session -t "$SESSION" 2>/dev/null || tmux new-session -d -s "$SESSION" -n _bootstrap -c "$ROOT"

Idempotent window creation from dev-local.template.sh:73-79:

start_window() {  # idempotent: skip if the window already exists
  local name="$1" cmd="$2"
  if tmux list-windows -t "$SESSION" -F '#{window_name}' 2>/dev/null | grep -qx "$name"; then
    warn "window '$name' already exists — leaving it alone"; return
  fi
  tmux new-window -t "$SESSION" -n "$name" -c "$ROOT"
  tmux send-keys -t "$SESSION:$name" "$cmd" C-m
}

Common Errors

Error Message Cause Solution
tmux not found. Install: brew install tmux tmux not installed Install via brew (macOS) or apt (Linux)
session not running No tmux session with the expected name Run scripts/dev-local.sh up first
open terminal failed: not a terminal No TTY available Run in an interactive shell, not a piped context

Compatibility Notes

  • macOS: Install via Homebrew (brew install tmux).
  • Linux: Most distributions include tmux in package repos.
  • Windows: Not available natively — use WSL2 with a Linux terminal.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment