tmux

Automate tmux session and pane control with standard commands.

3|Updated Jul 17, 2024
One-click install
npx skills add https://github.com/Castrozan/.dotfiles --skill tmux-castrozan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tmux
Source: https://github.com/Castrozan/.dotfiles/tree/main/agents/skills/tmux
Command: npx skills add https://github.com/Castrozan/.dotfiles --skill tmux-castrozan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Tmux session and pane management is tedious and error-prone when restarting dev servers, monitoring background processes, or coordinating work across multiple terminal panes. This Skill automates common tmux workflows to streamline development workflows.

Core Features & Use Cases

  • List and inspect windows: tmux list-windows -a
  • List panes in a window: tmux list-panes -t "session:window" -F "#{pane_index}: #{pane_current_command} - #{pane_current_path}"
  • Send commands to a pane: tmux send-keys -t "session:window.pane" "command" Enter
  • Capture pane output: tmux capture-pane -t "session:window.pane" -p
  • Dev server restart workflow: stop a running process in a pane, then start it again with a single command
  • Best practices: verify target pane before sending, and confirm outputs with captures

Quick Start

To begin, ensure tmux is installed and available in your shell. Then run:

  • List all windows: tmux list-windows -a
  • Attach to a session: tmux attach -t my_session
  • Send a command to a pane: tmux send-keys -t "my_session:0.0" "npm start" Enter
  • Restart a server in a pane: tmux send-keys -t "my_session:0.0" C-c Enter; tmux send-keys -t "my_session:0.0" "npm start" Enter

Frequently Asked Questions about tmux

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I send commands to a specific tmux pane?

You can send commands to a specific tmux pane using `tmux send-keys -t "session:window.pane" "command" Enter`. This automates terminal multiplexing by targeting exact panes for dev-server restarts or process execution.

What is the best way to restart a dev server inside an active tmux session?

To restart a dev server inside an active tmux session, send `C-c` to interrupt the running process, then send your start command like `npm start` using `tmux send-keys`. This automates the stop and start workflow in a single pane.

How can I list all active panes and their current commands in tmux?

To list active panes and their current commands in tmux, run `tmux list-panes -t "session:window" -F "#{pane_index}: #{pane_current_command} - #{pane_current_path}"`. This inspects pane status for multi-window coordination.

Can I capture real-time terminal output from a background tmux pane?

Yes, you can capture real-time terminal output from a background tmux pane using `tmux capture-pane -t "session:window.pane" -p`. This prints the pane buffer to stdout, enabling real-time process monitoring without attaching to the session.

Do I need any external dependencies to automate tmux session control?

No external dependencies are needed to automate tmux session control. The skill relies entirely on standard built-in tmux commands like `list-windows`, `list-panes`, `send-keys`, and `capture-pane` to orchestrate panes and manage dev-server workflows.