Skip to content
Back to skills

Tmux

ASecurity

Remote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.

  • 279 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 8, 2026
toolspythonshellbashapi

Works with

  • terminal
  • cli
  • api

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add infometa/workbuddyskills --skill tmux --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Tmux?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Tmux
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/infometa-tmux-workbuddyskills/badge)](https://www.skillsdirectory.com/skills/infometa-tmux-workbuddyskills)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: tmux
description: "Remote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output."
description_zh: "远程控制 tmux 交互式终端会话"
description_en: "Remote-control tmux terminal sessions"
version: 1.0.0
---

# tmux Skill

Use tmux only when you need an interactive TTY. Prefer bash background mode for long-running, non-interactive tasks.

## Quickstart (isolated socket)

```bash
SOCKET_DIR="${TMPDIR:-/tmp}/codebuddy-tmux-sockets"
mkdir -p "$SOCKET_DIR"
SOCKET="$SOCKET_DIR/codebuddy.sock"
SESSION=codebuddy-python

tmux -S "$SOCKET" new -d -s "$SESSION" -n shell
tmux -S "$SOCKET" send-keys -t "$SESSION":0.0 -- 'PYTHON_BASIC_REPL=1 python3 -q' Enter
tmux -S "$SOCKET" capture-pane -p -J -t "$SESSION":0.0 -S -200
```

## Socket convention

- Default socket dir: `${TMPDIR:-/tmp}/codebuddy-tmux-sockets`
- Default socket path: `"$SOCKET_DIR/codebuddy.sock"`

## Targeting panes

- Target format: `session:window.pane` (defaults to `:0.0`)
- Keep names short; avoid spaces.

## Finding sessions

- List sessions: `{baseDir}/scripts/find-sessions.sh -S "$SOCKET"`
- Scan all sockets: `{baseDir}/scripts/find-sessions.sh --all`

## Sending input safely

- Literal sends: `tmux -S "$SOCKET" send-keys -t target -l -- "$cmd"`
- Control keys: `tmux -S "$SOCKET" send-keys -t target C-c`

## Watching output

- Capture recent: `tmux -S "$SOCKET" capture-pane -p -J -t target -S -200`
- Wait for prompts: `{baseDir}/scripts/wait-for-text.sh -t session:0.0 -p 'pattern'`

## Cleanup

- Kill session: `tmux -S "$SOCKET" kill-session -t "$SESSION"`
- Kill all: `tmux -S "$SOCKET" kill-server`

## Helper: wait-for-text.sh

```bash
{baseDir}/scripts/wait-for-text.sh -t session:0.0 -p 'pattern' [-F] [-T 20] [-i 0.5] [-l 2000]
```

Files in this skill

  • SKILL.md1.7 KB
  • scripts/find-sessions.sh2.9 KB
  • scripts/wait-for-text.sh2.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…