From b24fdf0d8455d23bb9ef579e8b602e44170439af Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 1 Feb 2026 18:19:03 +0200 Subject: Prefill editor from cursor-agent prompt line. Capture the last prompt line and seed the temp file for editing. --- frontends/scripts/tmux-edit-send | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'frontends/scripts') diff --git a/frontends/scripts/tmux-edit-send b/frontends/scripts/tmux-edit-send index 5edafe1..a407d25 100644 --- a/frontends/scripts/tmux-edit-send +++ b/frontends/scripts/tmux-edit-send @@ -50,6 +50,12 @@ cleanup() { } trap cleanup EXIT +prompt_text="$(tmux capture-pane -p -t "$target" -S -2000 2>/dev/null | \ + awk '/^ *│ *→/ && index($0,"INSERT")==0 && index($0,"Add a follow-up")==0 {line=$0} END { if (line!="") { sub(/^.*→ ?/, "", line); sub(/[[:space:]│]+$/, "", line); print line } }')" +if [ -n "$prompt_text" ]; then + printf '%s\n' "$prompt_text" > "$tmpfile" +fi + "$editor" "$tmpfile" log "editor exited with status $?" -- cgit v1.2.3