Loading...
Loading...
Control interactive CLIs (python, gdb, etc.) via tmux sessions - send keystrokes and scrape output
npx skill4agent add connorads/dotfiles tmux# Create session
tmux new-session -d -s "$SESSION" -x 120 -y 40
# Send commands
tmux send-keys -t "$SESSION" "python3" Enter
# Capture output
tmux capture-pane -t "$SESSION" -p
# Wait for prompt (poll)
for i in {1..30}; do
output=$(tmux capture-pane -t "$SESSION" -p)
if echo "$output" | grep -q ">>>"; then break; fi
sleep 0.5
done
# Cleanup
tmux kill-session -t "$SESSION"# Non-interactive (won't hang)
ssh host 'zsh -c "source ~/.zshrc; tmux new-session -d -s mysession; tmux send-keys -t mysession python Enter"'
# Interactive (for tmux attach) - needs TTY
ssh host -t 'zsh -ilc "tmux attach -t mysession"'zsh -c "source ~/.zshrc; ..."zsh -lcTo monitor: tmux attach -t $SESSION
To capture: tmux capture-pane -t $SESSION -p-x 120 -y 40capture-pane -pwait-for-lC-cC-dEscapePYTHON_BASIC_REPL=1scripts/wait-for-text.sh -t session:0.0 -p '^>>>' -T 15scripts/find-sessions.sh -q claude # filter by name
scripts/find-sessions.sh --all # all sessions