repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by bugabinga

docs(tmux): add defensive Pi input

d4dc1c73c5545dcc6f63351f28453c8b9db6fab2

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (1)

skills/tmux/SKILL.md

Modified
122 122 Use nested Pi when you need a real agent session, not just `pi -p` output.
124 +Pi's TUI has autocomplete/editor state. Scripted input must be defensive:
126 +```bash
127 +# Discover exact pane; don't assume :0.0 (tmux may allocate window/pane index 1).
128 +tmux list-panes -a -F '#{session_name}:#{window_index}.#{pane_index} #{pane_current_command}'
130 +target="$name:1.1" # set from list-panes output
132 +pi_send() {
133 + tmux send-keys -t "$target" C-u # clear editor/autocomplete leftovers
134 + printf '%s' "$1" | tmux load-buffer - # exact paste, no shell quoting surprises
135 + tmux paste-buffer -t "$target"
136 + tmux send-keys -t "$target" Enter
139 +pi_send '/my-command arg'
140 +```
142 +If autocomplete opens, submitted text remains in editor, or command text merges with
143 +previous text: send `C-u`, retry. For prototype extensions, avoid command argument
144 +completions unless completion behavior is under test.
124 146 ```bash
125 147 name=pi_nested
126 148 work=/tmp/$name