AgentSkillsCN

tmux

通过tmux窗口管理后台进程(如服务器、构建任务)。

SKILL.md
--- frontmatter
name: tmux
description: Manage background processes (servers, builds) via tmux windows.

Tmux Skill

Run and monitor long-running processes without blocking the main session.

Quick Reference

ActionCommand
Create windowtmux new-window -n "ID" -d
Run commandtmux send-keys -t "ID" "CMD" C-m
Read outputtmux capture-pane -p -t "ID"
Full scrollbacktmux capture-pane -p -S - -t "ID"
Interrupt (Ctrl+C)tmux send-keys -t "ID" C-c
Kill windowtmux kill-window -t "ID"

Workflow

  1. Create a detached window: tmux new-window -n "server" -d
  2. Send command to it: tmux send-keys -t "server" "npm start" C-m
  3. Check output anytime: tmux capture-pane -p -t "server"
  4. Clean up when done: tmux kill-window -t "server"

Examples

bash
# One-liner: create window and start process
tmux new-window -n "server" -d ';' send-keys -t "server" "npm start" C-m

# Read full output history
tmux capture-pane -p -S - -t "server"