Loading...
Loading...
Use when you need to run interactive CLI tools (vim, git rebase -i, Python REPL, etc.) that require real-time input/output - provides tmux-based approach for controlling interactive sessions through detached sessions and send-keys
npx skill4agent add ovachiever/droid-tings using-tmux-for-interactive-commandssend-keyscapture-panegit rebase -igit add -p| Task | Command |
|---|---|
| Start session | |
| Send input | |
| Capture output | |
| Stop session | |
| List sessions | |
# This hangs because vim expects interactive terminal
bash -c "vim file.txt"# Create detached tmux session
tmux new-session -d -s edit_session vim file.txt
# Send commands (Enter, Escape are tmux key names)
tmux send-keys -t edit_session 'i' 'Hello World' Escape ':wq' Enter
# Capture what's on screen
tmux capture-pane -t edit_session -p
# Clean up
tmux kill-session -t edit_sessionsend-keyscapture-pane -pEnterEscapeC-cC-xUpDownLeftRightSpaceBSpacetmux new-session -d -s git_session -c /path/to/repo git rebase -i HEAD~3/home/jesse/git/interactive-command/tmux-wrapper.sh# Start session
/path/to/tmux-wrapper.sh start <session-name> <command> [args...]
# Send input
/path/to/tmux-wrapper.sh send <session-name> 'text' Enter
# Capture current state
/path/to/tmux-wrapper.sh capture <session-name>
# Stop
/path/to/tmux-wrapper.sh stop <session-name>tmux new-session -d -s python python3 -i
tmux send-keys -t python 'import math' Enter
tmux send-keys -t python 'print(math.pi)' Enter
tmux capture-pane -t python -p # See output
tmux kill-session -t pythontmux new-session -d -s vim vim /tmp/file.txt
sleep 0.3 # Wait for vim to start
tmux send-keys -t vim 'i' 'New content' Escape ':wq' Enter
# File is now savedtmux new-session -d -s rebase -c /repo/path git rebase -i HEAD~3
sleep 0.5
tmux capture-pane -t rebase -p # See rebase editor
# Send commands to modify rebase instructions
tmux send-keys -t rebase 'Down' 'Home' 'squash' Escape
tmux send-keys -t rebase ':wq' Enternew-sessiontmux new-session -d -s sess command
sleep 0.3 # Let command initialize
tmux capture-pane -t sess -ptmux send-keys -t sess 'print("hello")' Enter # Note: Enter is separate argumenttmux send-keys -t sess '\n'Enter\ntmux send-keys -t sess 'text' Enter # ✓
tmux send-keys -t sess 'text\n' # ✗tmux kill-session -t session_name
# Or check for existing: tmux has-session -t name 2>/dev/null