skills/tmuxcap/SKILL.md
Capture tmux pane content and export as text, HTML, SVG, PNG, or JPG. Use when you need a screenshot or text dump of a tmux pane for sharing, feeding to AI, or archiving terminal state.
npx skillsauth add hayeah/dotfiles tmuxcapInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Captures the visible content of a tmux pane (including ANSI colors) and exports it to various formats. Uses tmux capture-pane -ep under the hood, then renders via rich and Pillow.
cd skills/tmuxcap
uv tool install -e .
tmuxcap -t <target> -o <output_file>
-t, --target — tmux target pane (required)-o, --output — output file path; format is inferred from extension. If omitted, prints plain text to stdout-l, --lines — number of scrollback lines to capture (e.g. --lines 1000, or --lines all for entire buffer).txt — plain text (ANSI stripped, TUI chars cleaned).raw — plain text (ANSI stripped, TUI chars preserved).html — rich HTML with inline color styles.svg — vector SVG with embedded styles.png — raster image rendered with a monospace font.jpg / .jpeg — same as PNG but JPEG compressedThe -t flag accepts any tmux target format:
%42 — pane ID (find with tmux list-panes -a -F '#{pane_id}')mysession — active pane of a sessionmysession:2 — active pane of window 2 in mysessionmysession:2.1 — pane 1 of window 2 in mysession# Dump visible pane content to stdout as plain text
tmuxcap -t %0
# Capture a pane as a PNG screenshot for sharing with AI
tmuxcap -t %0 -o screenshot.png
# Capture as plain text for pasting into a document or prompt
tmuxcap -t %0 -o capture.txt
# Capture last 1000 lines of scrollback history to stdout
tmuxcap -t %0 --lines 1000
# Capture entire scrollback buffer to stdout
tmuxcap -t %0 --lines all
# Capture scrollback history to a file
tmuxcap -t %0 --lines 500 -o history.txt
# Capture a specific session's active pane as HTML
tmuxcap -t mysession -o output.html
# Capture as SVG (vector, scalable)
tmuxcap -t %6 -o terminal.svg
# Capture as JPEG (smaller file size)
tmuxcap -t %6 -o capture.jpg
# List all panes to find the right target
tmux list-panes -a -F '#{pane_id} #{session_name}:#{window_index}.#{pane_index} #{pane_width}x#{pane_height} #{pane_current_command}'
PNG/JPG image rendering remaps the base 16 ANSI colors through Rich's built-in MONOKAI terminal theme. This ensures colors are readable on the dark background — Rich's default ANSI-to-RGB mapping uses classic values (e.g. blue = #000080) that are invisible on dark backgrounds.
Available themes from rich.terminal_theme:
MONOKAI — vibrant colors on near-black background (current default)DIMMED_MONOKAI — muted/desaturated variantSVG_EXPORT_THEME — used by Rich's SVG exporttmux display-message so the image matches the actual terminal layout.txt cleans TUI box-drawing characters by default; .raw preserves them--lines N to include scrollback history, or --lines all for the entire buffertools
Web UI development — Vite+ toolchain setup and browser-based E2E testing workflow.
tools
Tooling and style guide for TypeScript projects.
testing
Copy-edit text. Fix grammar and/or tidy text into a concise listicle.
development
Design tokens and component patterns for Tailwind CSS projects.