16 lines
413 B
Bash
Executable File
16 lines
413 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# 현재 tmux 세션 이름 자동 추출
|
|
SESSION=$(tmux display-message -p '#S')
|
|
# 첫 번째 인자로 팬 번호를 받되, 없으면 기본값 0번 팬 사용
|
|
PANE=${1:-0}
|
|
TARGET="${SESSION}:0.${PANE}"
|
|
|
|
echo "Watching tmux pane: ${TARGET} ..."
|
|
|
|
while true; do
|
|
if tmux capture-pane -t "${TARGET}" -p | grep -q "> 1\. Yes"; then
|
|
tmux send-keys -t "${TARGET}" Enter
|
|
fi
|
|
sleep 2
|
|
done
|