[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CP4Z9NF9T3FS99RJYF64C4":3,"skill-same:01M7CP4Z9NF9T3FS99RJYF64C4":63},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":40,"commitSha":41,"skillDirectory":42,"forksCount":43,"repositoryHtmlUrl":44,"repositoryHomepageUrl":45,"ownerHtmlUrl":46,"ownerBlogUrl":6,"ownerDescription":47,"updatedAt":48,"install":49,"resources":62},"01M7CP4Z9NF9T3FS99RJYF64C4","tmux",null,"Expert tmux session, window, and pane management for terminal multiplexing, persistent remote workflows, and shell scripting automation.","YYC-Cube\u002FYYC3-Knowledge-Base","YYC-Cube","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F235006543?v=4","01M79J2PH4SWD2X0825X6PN748","yyc3","01M79J2PHVK3F6ZBYT8K2SCZCW",1,"MIT","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-Skills-技能包\u002FYYC3-Skills-技能包-antigravity-awesome-skills\u002Fskills\u002Ftmux\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: tmux\ndescription: \"Expert tmux session, window, and pane management for terminal multiplexing, persistent remote workflows, and shell scripting automation.\"\ncategory: development\nrisk: safe\nsource: community\ndate_added: \"2026-03-28\"\nauthor: kostakost2\ntags: [tmux, terminal, multiplexer, sessions, shell, remote, automation]\ntools: [claude, cursor, gemini]\n---\n\n# tmux — Terminal Multiplexer\n\n## Overview\n\n`tmux` keeps terminal sessions alive across SSH disconnects, splits work across multiple panes, and enables fully scriptable terminal automation. This skill covers session management, window\u002Fpane layout, keybinding patterns, and using `tmux` non-interactively from shell scripts — essential for remote servers, long-running jobs, and automated workflows.\n\n## When to Use This Skill\n\n- Use when setting up or managing persistent terminal sessions on remote servers\n- Use when the user needs to run long-running processes that survive SSH disconnects\n- Use when scripting multi-pane terminal layouts (e.g., logs + shell + editor)\n- Use when automating `tmux` commands from bash scripts without user interaction\n\n## How It Works\n\n`tmux` has three hierarchy levels: **sessions** (top level, survives disconnects), **windows** (tabs within a session), and **panes** (splits within a window). Everything is controllable from outside via `tmux \u003Ccommand>` or from inside via the prefix key (`Ctrl-b` by default).\n\n### Session Management\n\n```bash\n# Create a new named session\ntmux new-session -s work\n\n# Create detached (background) session\ntmux new-session -d -s work\n\n# Create detached session and start a command\ntmux new-session -d -s build -x 220 -y 50 \"make all\"\n\n# Attach to a session\ntmux attach -t work\ntmux attach          # attaches to most recent session\n\n# List all sessions\ntmux list-sessions\ntmux ls\n\n# Detach from inside tmux\n# Prefix + d   (Ctrl-b d)\n\n# Kill a session\ntmux kill-session -t work\n\n# Kill all sessions except the current one\ntmux kill-session -a\n\n# Rename a session from outside\ntmux rename-session -t old-name new-name\n\n# Switch to another session from outside\ntmux switch-client -t other-session\n\n# Check if a session exists (useful in scripts)\ntmux has-session -t work 2>\u002Fdev\u002Fnull && echo \"exists\"\n```\n\n### Window Management\n\n```bash\n# Create a new window in the current session\ntmux new-window -t work -n \"logs\"\n\n# Create a window running a specific command\ntmux new-window -t work:3 -n \"server\" \"python -m http.server 8080\"\n\n# List windows\ntmux list-windows -t work\n\n# Select (switch to) a window\ntmux select-window -t work:logs\ntmux select-window -t work:2       # by index\n\n# Rename a window\ntmux rename-window -t work:2 \"editor\"\n\n# Kill a window\ntmux kill-window -t work:logs\n\n# Move window to a new index\ntmux move-window -s work:3 -t work:1\n\n# From inside tmux:\n# Prefix + c     — new window\n# Prefix + ,     — rename window\n# Prefix + &     — kill window\n# Prefix + n\u002Fp   — next\u002Fprevious window\n# Prefix + 0-9   — switch to window by number\n```\n\n### Pane Management\n\n```bash\n# Split pane vertically (left\u002Fright)\ntmux split-window -h -t work:1\n\n# Split pane horizontally (top\u002Fbottom)\ntmux split-window -v -t work:1\n\n# Split and run a command\ntmux split-window -h -t work:1 \"tail -f \u002Fvar\u002Flog\u002Fsyslog\"\n\n# Select a pane by index\ntmux select-pane -t work:1.0\n\n# Resize panes\ntmux resize-pane -t work:1.0 -R 20   # expand right by 20 cols\ntmux resize-pane -t work:1.0 -D 10   # shrink down by 10 rows\ntmux resize-pane -Z                   # toggle zoom (fullscreen)\n\n# Swap panes\ntmux swap-pane -s work:1.0 -t work:1.1\n\n# Kill a pane\ntmux kill-pane -t work:1.1\n\n# From inside tmux:\n# Prefix + %     — split vertical\n# Prefix + \"     — split horizontal\n# Prefix + arrow — navigate panes\n# Prefix + z     — zoom\u002Funzoom current pane\n# Prefix + x     — kill pane\n# Prefix + {\u002F}   — swap pane with previous\u002Fnext\n```\n\n### Sending Commands to Panes Without Being Attached\n\n```bash\n# Send a command to a specific pane and press Enter\ntmux send-keys -t work:1.0 \"ls -la\" Enter\n\n# Run a command in a background pane without attaching\ntmux send-keys -t work:editor \"vim src\u002Fmain.py\" Enter\n\n# Send Ctrl+C to stop a running process\ntmux send-keys -t work:1.0 C-c\n\n# Send text without pressing Enter (useful for pre-filling prompts)\ntmux send-keys -t work:1.0 \"git commit -m '\"\n\n# Clear a pane\ntmux send-keys -t work:1.0 \"clear\" Enter\n\n# Check what's in a pane (capture its output)\ntmux capture-pane -t work:1.0 -p\ntmux capture-pane -t work:1.0 -p | grep \"ERROR\"\n```\n\n### Scripting a Full Workspace Layout\n\nThis is the most powerful pattern: create a fully configured multi-pane workspace from a single script.\n\n```bash\n#!\u002Fusr\u002Fbin\u002Fenv bash\nset -euo pipefail\n\nSESSION=\"dev\"\n\n# Bail if session already exists\ntmux has-session -t \"$SESSION\" 2>\u002Fdev\u002Fnull && {\n  echo \"Session $SESSION already exists. Attaching...\"\n  tmux attach -t \"$SESSION\"\n  exit 0\n}\n\n# Create session with first window\ntmux new-session -d -s \"$SESSION\" -n \"editor\" -x 220 -y 50\n\n# Window 1: editor + test runner side by side\ntmux send-keys -t \"$SESSION:editor\" \"vim .\" Enter\ntmux split-window -h -t \"$SESSION:editor\"\ntmux send-keys -t \"$SESSION:editor.1\" \"npm test -- --watch\" Enter\ntmux select-pane -t \"$SESSION:editor.0\"\n\n# Window 2: server logs\ntmux new-window -t \"$SESSION\" -n \"server\"\ntmux send-keys -t \"$SESSION:server\" \"docker compose up\" Enter\ntmux split-window -v -t \"$SESSION:server\"\ntmux send-keys -t \"$SESSION:server.1\" \"tail -f logs\u002Fapp.log\" Enter\n\n# Window 3: general shell\ntmux new-window -t \"$SESSION\" -n \"shell\"\n\n# Focus first window\ntmux select-window -t \"$SESSION:editor\"\n\n# Attach\ntmux attach -t \"$SESSION\"\n```\n\n### Configuration (`~\u002F.tmux.conf`)\n\n```bash\n# Change prefix to Ctrl-a (screen-style)\nunbind C-b\nset -g prefix C-a\nbind C-a send-prefix\n\n# Enable mouse support\nset -g mouse on\n\n# Start window\u002Fpane numbering at 1\nset -g base-index 1\nsetw -g pane-base-index 1\n\n# Renumber windows when one is closed\nset -g renumber-windows on\n\n# Increase scrollback buffer\nset -g history-limit 50000\n\n# Use vi keys in copy mode\nsetw -g mode-keys vi\n\n# Faster key repetition\nset -s escape-time 0\n\n# Reload config without restarting\nbind r source-file ~\u002F.tmux.conf \\; display \"Config reloaded\"\n\n# Intuitive splits: | and -\nbind | split-window -h -c \"#{pane_current_path}\"\nbind - split-window -v -c \"#{pane_current_path}\"\n\n# New windows open in current directory\nbind c new-window -c \"#{pane_current_path}\"\n\n# Status bar\nset -g status-right \"#{session_name} | %H:%M %d-%b\"\nset -g status-interval 5\n```\n\n### Copy Mode and Scrollback\n\n```bash\n# Enter copy mode (scroll up through output)\n# Prefix + [\n\n# In vi mode:\n# \u002F to search forward, ? to search backward\n# Space to start selection, Enter to copy\n# q to exit copy mode\n\n# Paste the most recent buffer\n# Prefix + ]\n\n# List paste buffers\ntmux list-buffers\n\n# Show the most recent buffer\ntmux show-buffer\n\n# Save buffer to a file\ntmux save-buffer \u002Ftmp\u002Ftmux-output.txt\n\n# Load a file into a buffer\ntmux load-buffer \u002Ftmp\u002Fdata.txt\n\n# Pipe pane output to a command\ntmux pipe-pane -t work:1.0 \"cat >> ~\u002Fsession.log\"\n```\n\n### Practical Automation Patterns\n\n```bash\n# Idempotent session: create or attach\nensure_session() {\n  local name=\"$1\"\n  tmux has-session -t \"$name\" 2>\u002Fdev\u002Fnull \\\n    || tmux new-session -d -s \"$name\"\n  tmux attach -t \"$name\"\n}\n\n# Run a command in a new background window and tail its output\nrun_bg() {\n  local session=\"${1:-main}\" cmd=\"${*:2}\"\n  tmux new-window -t \"$session\" -n \"bg-$$\"\n  tmux send-keys -t \"$session:bg-$$\" \"$cmd\" Enter\n}\n\n# Wait for a pane to produce specific output (polling)\nwait_for_output() {\n  local target=\"$1\" pattern=\"$2\" timeout=\"${3:-30}\"\n  local elapsed=0\n  while (( elapsed \u003C timeout )); do\n    tmux capture-pane -t \"$target\" -p | grep -q \"$pattern\" && return 0\n    sleep 1\n    (( elapsed++ ))\n  done\n  return 1\n}\n\n# Kill all background windows matching a name prefix\nkill_bg_windows() {\n  local session=\"$1\" prefix=\"${2:-bg-}\"\n  tmux list-windows -t \"$session\" -F \"#W\" \\\n    | grep \"^${prefix}\" \\\n    | while read -r win; do\n        tmux kill-window -t \"${session}:${win}\"\n      done\n}\n```\n\n### Remote and SSH Workflows\n\n```bash\n# SSH and immediately attach to an existing session\nssh user@host -t \"tmux attach -t work || tmux new-session -s work\"\n\n# Run a command on remote host inside a tmux session (fire and forget)\nssh user@host \"tmux new-session -d -s deploy 'bash \u002Fopt\u002Fdeploy.sh'\"\n\n# Watch the remote session output from another terminal\nssh user@host -t \"tmux attach -t deploy -r\"  # read-only attach\n\n# Pair programming: share a session (both users attach to the same session)\n# User 1:\ntmux new-session -s shared\n# User 2 (same server):\ntmux attach -t shared\n```\n\n## Best Practices\n\n- Always name sessions (`-s name`) in scripts — unnamed sessions are hard to target reliably\n- Use `tmux has-session -t name 2>\u002Fdev\u002Fnull` before creating to make scripts idempotent\n- Set `-x` and `-y` when creating detached sessions to give panes a proper size for commands that check terminal dimensions\n- Use `send-keys ... Enter` for automation rather than piping stdin — it works even when the target pane is running an interactive program\n- Keep `~\u002F.tmux.conf` in version control for reproducibility across machines\n- Prefer `bind -n` for bindings that don't need the prefix, but only for keys that don't conflict with application shortcuts\n\n## Security & Safety Notes\n\n- `send-keys` executes commands in a pane without confirmation — verify the target (`-t session:window.pane`) before use in scripts to avoid sending keystrokes to the wrong pane\n- Read-only attach (`-r`) is appropriate when sharing sessions with others to prevent accidental input\n- Avoid storing secrets in tmux window\u002Fpane titles or environment variables exported into sessions on shared machines\n\n## Common Pitfalls\n\n- **Problem:** `tmux` commands from a script fail with \"no server running\"\n  **Solution:** Start the server first with `tmux start-server`, or create a detached session before running other commands.\n\n- **Problem:** Pane size is 0x0 when creating a detached session\n  **Solution:** Pass explicit dimensions: `tmux new-session -d -s name -x 200 -y 50`.\n\n- **Problem:** `send-keys` types the text but doesn't run the command\n  **Solution:** Ensure you pass `Enter` (capital E) as a second argument: `tmux send-keys -t target \"cmd\" Enter`.\n\n- **Problem:** Script creates a duplicate session each run\n  **Solution:** Guard with `tmux has-session -t name 2>\u002Fdev\u002Fnull || tmux new-session -d -s name`.\n\n- **Problem:** Copy-mode selection doesn't work as expected\n  **Solution:** Confirm `mode-keys vi` or `mode-keys emacs` is set to match your preference in `~\u002F.tmux.conf`.\n\n## Related Skills\n\n- `@bash-pro` — Writing the shell scripts that orchestrate tmux sessions\n- `@bash-linux` — General Linux terminal patterns used inside tmux panes\n- `@ssh` — Combining tmux with SSH for persistent remote workflows\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","# tmux — Terminal Multiplexer\n\n## Overview\n\n`tmux` keeps terminal sessions alive across SSH disconnects, splits work across multiple panes, and enables fully scriptable terminal automation. This skill covers session management, window\u002Fpane layout, keybinding patterns, and using `tmux` non-interactively from shell scripts — essential for remote servers, long-running jobs, and automated workflows.\n\n## When to Use This Skill\n\n- Use when setting up or managing persistent terminal sessions on remote servers\n- Use when the user needs to run long-running processes that survive SSH disconnects\n- Use when scripting multi-pane terminal layouts (e.g., logs + shell + editor)\n- Use when automating `tmux` commands from bash scripts without user interaction\n\n## How It Works\n\n`tmux` has three hierarchy levels: **sessions** (top level, survives disconnects), **windows** (tabs within a session), and **panes** (splits within a window). Everything is controllable from outside via `tmux \u003Ccommand>` or from inside via the prefix key (`Ctrl-b` by default).\n\n### Session Management\n\n```bash\n# Create a new named session\ntmux new-session -s work\n\n# Create detached (background) session\ntmux new-session -d -s work\n\n# Create detached session and start a command\ntmux new-session -d -s build -x 220 -y 50 \"make all\"\n\n# Attach to a session\ntmux attach -t work\ntmux attach          # attaches to most recent session\n\n# List all sessions\ntmux list-sessions\ntmux ls\n\n# Detach from inside tmux\n# Prefix + d   (Ctrl-b d)\n\n# Kill a session\ntmux kill-session -t work\n\n# Kill all sessions except the current one\ntmux kill-session -a\n\n# Rename a session from outside\ntmux rename-session -t old-name new-name\n\n# Switch to another session from outside\ntmux switch-client -t other-session\n\n# Check if a session exists (useful in scripts)\ntmux has-session -t work 2>\u002Fdev\u002Fnull && echo \"exists\"\n```\n\n### Window Management\n\n```bash\n# Create a new window in the current session\ntmux new-window -t work -n \"logs\"\n\n# Create a window running a specific command\ntmux new-window -t work:3 -n \"server\" \"python -m http.server 8080\"\n\n# List windows\ntmux list-windows -t work\n\n# Select (switch to) a window\ntmux select-window -t work:logs\ntmux select-window -t work:2       # by index\n\n# Rename a window\ntmux rename-window -t work:2 \"editor\"\n\n# Kill a window\ntmux kill-window -t work:logs\n\n# Move window to a new index\ntmux move-window -s work:3 -t work:1\n\n# From inside tmux:\n# Prefix + c     — new window\n# Prefix + ,     — rename window\n# Prefix + &     — kill window\n# Prefix + n\u002Fp   — next\u002Fprevious window\n# Prefix + 0-9   — switch to window by number\n```\n\n### Pane Management\n\n```bash\n# Split pane vertically (left\u002Fright)\ntmux split-window -h -t work:1\n\n# Split pane horizontally (top\u002Fbottom)\ntmux split-window -v -t work:1\n\n# Split and run a command\ntmux split-window -h -t work:1 \"tail -f \u002Fvar\u002Flog\u002Fsyslog\"\n\n# Select a pane by index\ntmux select-pane -t work:1.0\n\n# Resize panes\ntmux resize-pane -t work:1.0 -R 20   # expand right by 20 cols\ntmux resize-pane -t work:1.0 -D 10   # shrink down by 10 rows\ntmux resize-pane -Z                   # toggle zoom (fullscreen)\n\n# Swap panes\ntmux swap-pane -s work:1.0 -t work:1.1\n\n# Kill a pane\ntmux kill-pane -t work:1.1\n\n# From inside tmux:\n# Prefix + %     — split vertical\n# Prefix + \"     — split horizontal\n# Prefix + arrow — navigate panes\n# Prefix + z     — zoom\u002Funzoom current pane\n# Prefix + x     — kill pane\n# Prefix + {\u002F}   — swap pane with previous\u002Fnext\n```\n\n### Sending Commands to Panes Without Being Attached\n\n```bash\n# Send a command to a specific pane and press Enter\ntmux send-keys -t work:1.0 \"ls -la\" Enter\n\n# Run a command in a background pane without attaching\ntmux send-keys -t work:editor \"vim src\u002Fmain.py\" Enter\n\n# Send Ctrl+C to stop a running process\ntmux send-keys -t work:1.0 C-c\n\n# Send text without pressing Enter (useful for pre-filling prompts)\ntmux send-keys -t work:1.0 \"git commit -m '\"\n\n# Clear a pane\ntmux send-keys -t work:1.0 \"clear\" Enter\n\n# Check what's in a pane (capture its output)\ntmux capture-pane -t work:1.0 -p\ntmux capture-pane -t work:1.0 -p | grep \"ERROR\"\n```\n\n### Scripting a Full Workspace Layout\n\nThis is the most powerful pattern: create a fully configured multi-pane workspace from a single script.\n\n```bash\n#!\u002Fusr\u002Fbin\u002Fenv bash\nset -euo pipefail\n\nSESSION=\"dev\"\n\n# Bail if session already exists\ntmux has-session -t \"$SESSION\" 2>\u002Fdev\u002Fnull && {\n  echo \"Session $SESSION already exists. Attaching...\"\n  tmux attach -t \"$SESSION\"\n  exit 0\n}\n\n# Create session with first window\ntmux new-session -d -s \"$SESSION\" -n \"editor\" -x 220 -y 50\n\n# Window 1: editor + test runner side by side\ntmux send-keys -t \"$SESSION:editor\" \"vim .\" Enter\ntmux split-window -h -t \"$SESSION:editor\"\ntmux send-keys -t \"$SESSION:editor.1\" \"npm test -- --watch\" Enter\ntmux select-pane -t \"$SESSION:editor.0\"\n\n# Window 2: server logs\ntmux new-window -t \"$SESSION\" -n \"server\"\ntmux send-keys -t \"$SESSION:server\" \"docker compose up\" Enter\ntmux split-window -v -t \"$SESSION:server\"\ntmux send-keys -t \"$SESSION:server.1\" \"tail -f logs\u002Fapp.log\" Enter\n\n# Window 3: general shell\ntmux new-window -t \"$SESSION\" -n \"shell\"\n\n# Focus first window\ntmux select-window -t \"$SESSION:editor\"\n\n# Attach\ntmux attach -t \"$SESSION\"\n```\n\n### Configuration (`~\u002F.tmux.conf`)\n\n```bash\n# Change prefix to Ctrl-a (screen-style)\nunbind C-b\nset -g prefix C-a\nbind C-a send-prefix\n\n# Enable mouse support\nset -g mouse on\n\n# Start window\u002Fpane numbering at 1\nset -g base-index 1\nsetw -g pane-base-index 1\n\n# Renumber windows when one is closed\nset -g renumber-windows on\n\n# Increase scrollback buffer\nset -g history-limit 50000\n\n# Use vi keys in copy mode\nsetw -g mode-keys vi\n\n# Faster key repetition\nset -s escape-time 0\n\n# Reload config without restarting\nbind r source-file ~\u002F.tmux.conf \\; display \"Config reloaded\"\n\n# Intuitive splits: | and -\nbind | split-window -h -c \"#{pane_current_path}\"\nbind - split-window -v -c \"#{pane_current_path}\"\n\n# New windows open in current directory\nbind c new-window -c \"#{pane_current_path}\"\n\n# Status bar\nset -g status-right \"#{session_name} | %H:%M %d-%b\"\nset -g status-interval 5\n```\n\n### Copy Mode and Scrollback\n\n```bash\n# Enter copy mode (scroll up through output)\n# Prefix + [\n\n# In vi mode:\n# \u002F to search forward, ? to search backward\n# Space to start selection, Enter to copy\n# q to exit copy mode\n\n# Paste the most recent buffer\n# Prefix + ]\n\n# List paste buffers\ntmux list-buffers\n\n# Show the most recent buffer\ntmux show-buffer\n\n# Save buffer to a file\ntmux save-buffer \u002Ftmp\u002Ftmux-output.txt\n\n# Load a file into a buffer\ntmux load-buffer \u002Ftmp\u002Fdata.txt\n\n# Pipe pane output to a command\ntmux pipe-pane -t work:1.0 \"cat >> ~\u002Fsession.log\"\n```\n\n### Practical Automation Patterns\n\n```bash\n# Idempotent session: create or attach\nensure_session() {\n  local name=\"$1\"\n  tmux has-session -t \"$name\" 2>\u002Fdev\u002Fnull \\\n    || tmux new-session -d -s \"$name\"\n  tmux attach -t \"$name\"\n}\n\n# Run a command in a new background window and tail its output\nrun_bg() {\n  local session=\"${1:-main}\" cmd=\"${*:2}\"\n  tmux new-window -t \"$session\" -n \"bg-$$\"\n  tmux send-keys -t \"$session:bg-$$\" \"$cmd\" Enter\n}\n\n# Wait for a pane to produce specific output (polling)\nwait_for_output() {\n  local target=\"$1\" pattern=\"$2\" timeout=\"${3:-30}\"\n  local elapsed=0\n  while (( elapsed \u003C timeout )); do\n    tmux capture-pane -t \"$target\" -p | grep -q \"$pattern\" && return 0\n    sleep 1\n    (( elapsed++ ))\n  done\n  return 1\n}\n\n# Kill all background windows matching a name prefix\nkill_bg_windows() {\n  local session=\"$1\" prefix=\"${2:-bg-}\"\n  tmux list-windows -t \"$session\" -F \"#W\" \\\n    | grep \"^${prefix}\" \\\n    | while read -r win; do\n        tmux kill-window -t \"${session}:${win}\"\n      done\n}\n```\n\n### Remote and SSH Workflows\n\n```bash\n# SSH and immediately attach to an existing session\nssh user@host -t \"tmux attach -t work || tmux new-session -s work\"\n\n# Run a command on remote host inside a tmux session (fire and forget)\nssh user@host \"tmux new-session -d -s deploy 'bash \u002Fopt\u002Fdeploy.sh'\"\n\n# Watch the remote session output from another terminal\nssh user@host -t \"tmux attach -t deploy -r\"  # read-only attach\n\n# Pair programming: share a session (both users attach to the same session)\n# User 1:\ntmux new-session -s shared\n# User 2 (same server):\ntmux attach -t shared\n```\n\n## Best Practices\n\n- Always name sessions (`-s name`) in scripts — unnamed sessions are hard to target reliably\n- Use `tmux has-session -t name 2>\u002Fdev\u002Fnull` before creating to make scripts idempotent\n- Set `-x` and `-y` when creating detached sessions to give panes a proper size for commands that check terminal dimensions\n- Use `send-keys ... Enter` for automation rather than piping stdin — it works even when the target pane is running an interactive program\n- Keep `~\u002F.tmux.conf` in version control for reproducibility across machines\n- Prefer `bind -n` for bindings that don't need the prefix, but only for keys that don't conflict with application shortcuts\n\n## Security & Safety Notes\n\n- `send-keys` executes commands in a pane without confirmation — verify the target (`-t session:window.pane`) before use in scripts to avoid sending keystrokes to the wrong pane\n- Read-only attach (`-r`) is appropriate when sharing sessions with others to prevent accidental input\n- Avoid storing secrets in tmux window\u002Fpane titles or environment variables exported into sessions on shared machines\n\n## Common Pitfalls\n\n- **Problem:** `tmux` commands from a script fail with \"no server running\"\n  **Solution:** Start the server first with `tmux start-server`, or create a detached session before running other commands.\n\n- **Problem:** Pane size is 0x0 when creating a detached session\n  **Solution:** Pass explicit dimensions: `tmux new-session -d -s name -x 200 -y 50`.\n\n- **Problem:** `send-keys` types the text but doesn't run the command\n  **Solution:** Ensure you pass `Enter` (capital E) as a second argument: `tmux send-keys -t target \"cmd\" Enter`.\n\n- **Problem:** Script creates a duplicate session each run\n  **Solution:** Guard with `tmux has-session -t name 2>\u002Fdev\u002Fnull || tmux new-session -d -s name`.\n\n- **Problem:** Copy-mode selection doesn't work as expected\n  **Solution:** Confirm `mode-keys vi` or `mode-keys emacs` is set to match your preference in `~\u002F.tmux.conf`.\n\n## Related Skills\n\n- `@bash-pro` — Writing the shell scripts that orchestrate tmux sessions\n- `@bash-linux` — General Linux terminal patterns used inside tmux panes\n- `@ssh` — Combining tmux with SSH for persistent remote workflows\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n",{"name":5,"risk":24,"tags":25,"tools":32,"author":36,"source":37,"category":38,"date_added":39,"description":7},"safe",[5,26,27,28,29,30,31],"terminal","multiplexer","sessions","shell","remote","automation",[33,34,35],"claude","cursor","gemini","kostakost2","community","development","2026-03-28","main","87afe6ce96220accf50a345dea46784c8c9f210e","YYC3-Skills-技能包\u002FYYC3-Skills-技能包-antigravity-awesome-skills\u002Fskills\u002Ftmux",0,"https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base","https:\u002F\u002Fkb.yyc3.top\u002F","https:\u002F\u002Fgithub.com\u002FYYC-Cube","万象归元于云枢 | 深栈智启新纪元","2026-11-10 10:37:32",{"source":8,"skillName":5,"commands":50,"prompt":60,"zipAvailable":61},[51,54,57],{"tool":52,"command":53},"npx","npx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill tmux",{"tool":55,"command":56},"bunx","bunx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill tmux",{"tool":58,"command":59},"pnpm","pnpm dlx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill tmux","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-Skills-技能包\u002FYYC3-Skills-技能包-antigravity-awesome-skills\u002Fskills\u002Ftmux\u002FSKILL.md",true,[],[64,71,78,85,92,99],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M7CTDWHERCXPQCP0K03A86AS","vercel-sandbox","Run agent-browser + Chrome inside Vercel Sandbox microVMs for browser automation from any Vercel-deployed app. Use when the user needs browser automation in a Vercel app (Next.js, SvelteKit, Nuxt, Remix, Astro, etc.), wants to run headless Chrome without binary size limits, needs persistent browser sessions across commands, or wants ephemeral isolated browser environments. Triggers include \"Vercel Sandbox browser\", \"microVM Chrome\", \"agent-browser in sandbox\", \"browser automation on Vercel\", or any task requiring Chrome in a Vercel Sandbox.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fvercel-sandbox\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M7CTD8D2BNJY54S65M47HEJA","slack","Interact with Slack workspaces using browser automation. Use when the user needs to check unread channels, navigate Slack, send messages, extract data, find information, search conversations, or automate any Slack task. Triggers include \"check my Slack\", \"what channels have unreads\", \"send a message to\", \"search Slack for\", \"extract from Slack\", \"find who said\", or any task requiring programmatic Slack interaction.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fslack\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M7CTCSSB8ZP3Q58C3YZDZK1W","electron","Automate Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify, etc.) using agent-browser via Chrome DevTools Protocol. Use when the user needs to interact with an Electron app, automate a desktop app, connect to a running app, control a native app, or test an Electron application. Triggers include \"automate Slack app\", \"control VS Code\", \"interact with Discord app\", \"test this Electron app\", \"connect to desktop app\", or any task requiring automation of a native Electron application.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Felectron\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7CTCBJY76688V4DCZGWFHGQ","dogfood","Systematically explore and test a web application to find bugs, UX issues, and other problems. Use when asked to \"dogfood\", \"QA\", \"exploratory test\", \"find issues\", \"bug hunt\", \"test this app\u002Fsite\u002Fplatform\", or review the quality of a web application. Produces a structured report with full reproduction evidence -- step-by-step screenshots, repro videos, and detailed repro steps for every issue -- so findings can be handed directly to the responsible teams.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fdogfood\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M7CTC4H0FFGVEAQR9PA4GA1A","agent-browser","Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to \"open a website\", \"fill out a form\", \"click a button\", \"take a screenshot\", \"scrape data from a page\", \"test this web app\", \"login to a site\", \"automate browser actions\", or any task requiring programmatic web interaction.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fagent-browser\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":19},"01M7CTBKVFYBG78FDSABSDJTTQ","shadcn","Manages shadcn components and projects — adding, searching, fixing, debugging, styling, and composing UI, including chat interfaces. Provides project context, component docs, and usage examples. Applies when working with shadcn\u002Fui, component registries, presets, --preset codes, or any project with a components.json file. Also triggers for \"shadcn init\", \"create an app with --preset\", \"switch to --preset\", and for building a design system or applying a DESIGN.md or brand spec to shadcn\u002Fui.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-UI-界面组件\u002FYYC3-UI-界面组件-ui\u002Fskills\u002Fshadcn\u002FSKILL.md",[],[]]