code
<subsection name="Create or Attach"> <command description="Create new session">tmux new-session -d -s "session-name"</command> <command description="Attach to existing">tmux attach-session -t "session-name"</command> <command description="Create if not exists, attach if exists">tmux new-session -A -s "session-name"</command> </subsection>
code
<subsection name="Capture Output"> <command description="Capture pane contents">tmux capture-pane -t "session-name" -p</command> <command description="Capture with history (last 1000 lines)">tmux capture-pane -t "session-name" -p -S -1000</command> </subsection>
code
<pattern name="Check Process Status"> <description>Capture output to see if process completed</description> <command>tmux capture-pane -t "build" -p | tail -20</command> </pattern> <pattern name="Cleanup"> <command description="Kill specific session">tmux kill-session -t "session-name"</command> <command description="Kill all sessions">tmux kill-server</command> </pattern>