Loading...
Loading...
Manages background processes, captures command output, and handles session multiplexing. Use when running long-running commands, capturing output from detached processes, or managing concurrent tasks in headless environments.
npx skill4agent add knoopx/pi tmux| Command | Description |
|---|---|
| Run command in background session |
| Capture output from session |
| Send input to session |
| Terminate session |
| List all sessions |
| Check if session exists |
# Run command in new detached session
tmux new-session -d -s myserver 'python -m http.server 8080'
# With specific working directory
tmux new-session -d -s build -c /path/to/project 'make build'
# Keep session alive after command completes
tmux new-session -d -s task 'command; exec bash'
# Run only if session doesn't exist
tmux has -t myserver || tmux new-session -d -s myserver 'command'# Capture visible output
tmux capture-pane -t mysession -p
# Capture entire scrollback history
tmux capture-pane -t mysession -p -S -
# Capture last N lines
tmux capture-pane -t mysession -p -S -100
# Save to file
tmux capture-pane -t mysession -p > output.txt
# Capture with escape sequences (colors)
tmux capture-pane -t mysession -p -e# Send text and Enter
tmux send-keys -t mysession 'echo hello' Enter
# Send without Enter
tmux send-keys -t mysession 'some-text'
# Send Ctrl+C
tmux send-keys -t mysession C-c# List sessions
tmux list-sessions
tmux ls
# Kill specific session
tmux kill-session -t myserver
# Kill all sessions
tmux kill-server
# Check if session exists
tmux has -t mysession# Signal completion from command
tmux new-session -d -s job 'command; tmux wait-for -S job-done'
# Wait for signal
tmux wait-for job-donetmux new-session -d -s backend 'bun run backend'
tmux new-session -d -s frontend 'bun run frontend'
tmux new-session -d -s tests 'vitest --watch'tmux new-session -d -s job 'command'
sleep 0.5
output=$(tmux capture-pane -t job -p)
echo "$output"tmux has -t myserver || tmux new-session -d -s myserver 'command'tmux kill-session -t backend
tmux kill-session -t frontend
tmux kill-server # Kill alltmux new-session -dtmux capture-pane -p -S -tmux has -t nametmux kill-server-c /pathexec bash