Langsung ke konten
Skillpedia
Deploy & cloud (DevOps)48k Β· #5998

tmux

Fungsinya

tmux adalah tool yang memungkinkan Anda mengatur dan menyimpan beberapa jendela (window) serta pembagian layar (disebut 'pane') dalam satu terminal. Tool ini berguna agar pekerjaan Anda tetap berjalan meskipun Anda terputus dari server jarak jauh.

Kapan dipakai

  • βœ“Saat Anda perlu menjaga agar sebuah proses di server tetap berjalan setelah koneksi terputus.
  • βœ“Saat Anda ingin mengatur pekerjaan ke dalam beberapa 'layar' (window) atau pembagian layar di dalam terminal.
  • βœ“Saat Anda ingin mengotomatisasi tugas terminal yang berulang menggunakan skrip.

Link skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/tmux/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/tmux/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBagaimana cara membuat sesi bernama 'my-work' yang tetap berjalan meskipun koneksi saya terputus?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

tmux mengatur pekerjaan ke dalam sesi (session), jendela (window, seperti tab), dan pane (pembagian layar). Anda bisa mengendalikan semuanya melalui perintah terminal atau pintasan keyboard.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

tmux β€” Terminal Multiplexer

Overview

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/pane layout, keybinding patterns, and using tmux non-interactively from shell scripts β€” essential for remote servers, long-running jobs, and automated workflows.

When to Use This Skill

  • Use when setting up or managing persistent terminal sessions on remote servers
  • Use when the user needs to run long-running processes that survive SSH disconnects
  • Use when scripting multi-pane terminal layouts (e.g., logs + shell + editor)
  • Use when automating tmux commands from bash scripts without user interaction

How It Works

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 <command> or from inside via the prefix key (Ctrl-b by default).

Session Management

# Create a new named session
tmux new-session -s work

# Create detached (background) session
tmux new-session -d -s work

# Create detached session and start a command
tmux new-session -d -s build -x 220 -y 50 "make all"

# Attach to a session
tmux attach -t work
tmux attach          # attaches to most recent session

# List all sessions
tmux list-sessions
tmux ls

# Detach from inside tmux
# Prefix + d   (Ctrl-b d)

# Kill a session
tmux kill-session -t work

# Kill all sessions except the current one
tmux kill-session -a

# Rename a session from outside
tmux rename-session -t old-name new-name

# Switch to another session from outside
tmux switch-client -t other-session

# Check if a session exists (useful in scripts)
tmux has-session -t work 2>/dev/null && echo "exists"

Window Management

# Create a new window in the current session
tmux new-window -t work -n "logs"

# Create a window running a specific command
tmux new-window -t work:3 -n "server" "python -m http.server 8080"

# List windows
tmux list-windows -t work

# Select (switch to) a window
tmux select-window -t work:logs
tmux select-window -t work:2       # by index

# Rename a window
tmux rename-window -t work:2 "editor"

# Kill a window
tmux kill-window -t work:logs

# Move window to a new index
tmux move-window -s work:3 -t work:1

# From inside tmux:
# Prefix + c     β€” new window
# Prefix + ,     β€” rename window
# Prefix + &     β€” kill window
# Prefix + n/p   β€” next/previous window
# Prefix + 0-9   β€” switch to window by number

Pane Management

# Split pane vertically (left/right)
tmux split-window -h -t work:1

# Split pane horizontally (top/bottom)
tmux split-window -v -t work:1

# Split and run a command
tmux split-window -h -t work:1 "tail -f /var/log/syslog"

# Select a pane by index
tmux select-pane -t work:1.0

# Resize panes
tmux resize-pane -t work:1.0 -R 20   # expand right by 20 cols
tmux resize-pane -t work:1.0 -D 10   # shrink down by 10 rows
tmux resize-pane -Z                   # toggle zoom (fullscreen)

# Swap panes
tmux swap-pane -s work:1.0 -t work:1.1

# Kill a pane
tmux kill-pane -t work:1.1

# From inside tmux:
# Prefix + %     β€” split vertical
# Prefix + "     β€” split horizontal
# Prefix + arrow β€” navigate panes
# Prefix + z     β€” zoom/unzoom current pane
# Prefix + x     β€” kill pane
# Prefix + {/}   β€” swap pane with previous/next

Sending Commands to Panes Without Being Attached

# Send a command to a specific pane and press Enter
tmux send-keys -t work:1.0 "ls -la" Enter

# Run a command in a background pane without attaching
tmux send-keys -t work:editor "vim src/main.py" Enter

# Send Ctrl+C to stop a running process
tmux send-keys -t work:1.0 C-c

# Send text without pressing Enter (useful for pre-filling prompts)
tmux send-keys -t work:1.0 "git commit -m '"

# Clear a pane
tmux send-keys -t work:1.0 "clear" Enter

# Check what's in a pane (capture its output)
tmux capture-pane -t work:1.0 -p
tmux capture-pane -t work:1.0 -p | grep "ERROR"

Scripting a Full Workspace Layout

This is the most powerful pattern: create a fully configured multi-pane workspace from a single script.

#!/usr/bin/env bash
set -euo pipefail

SESSION="dev"

# Bail if session already exists
tmux has-session -t "$SESSION" 2>/dev/null && {
  echo "Session $SESSION already exists. Attaching..."
  tmux attach -t "$SESSION"

…
Pertanyaan umum

Apa yang terjadi jika koneksi internet saya terputus?

Dengan tmux, sesi kerja Anda tetap berjalan di server. Anda bisa terhubung kembali dan melanjutkan dari tempat Anda terakhir berhenti.

Bagaimana cara melihat semua sesi yang sedang aktif?

Anda bisa menggunakan perintah `tmux ls` untuk menampilkan semua sesi yang sedang berjalan.

Bagaimana cara keluar dari sesi tanpa menutupnya?

Di dalam tmux, tekan prefix key (biasanya Ctrl+b), lalu tekan huruf 'd' (dari kata detach) untuk keluar tanpa mengakhiri sesi.

Detail

Deskripsi asli dari pembuat

Expert tmux session, window, and pane management for terminal multiplexing, persistent remote workflows, and shell scripting automation.

repo: sickn33/agentic-awesome-skills

Popularitas

Bintang GitHub
48k
Peringkat
#5998
Lisensi
MIT
Diperbarui
15/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa