From aad3c58b14aa90ef88ee12741760517862d7ec29 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 1 Feb 2026 18:37:29 +0200 Subject: Strip prefilled prompt from first line. Avoid sending duplicated prompt text back to the pane. --- frontends/scripts/tmux-edit-send | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'frontends/scripts') diff --git a/frontends/scripts/tmux-edit-send b/frontends/scripts/tmux-edit-send index a407d25..9e70544 100644 --- a/frontends/scripts/tmux-edit-send +++ b/frontends/scripts/tmux-edit-send @@ -86,7 +86,15 @@ if [ "$target_found" -ne 1 ]; then fi # Send line by line to preserve newlines reliably. +first_line=1 while IFS= read -r line || [ -n "$line" ]; do + if [ "$first_line" -eq 1 ] && [ -n "${prompt_text:-}" ]; then + if [[ "$line" == "$prompt_text"* ]]; then + line="${line#"$prompt_text"}" + line="${line# }" + fi + fi + first_line=0 tmux send-keys -t "$target" -l "$line" tmux send-keys -t "$target" Enter done < "$tmpfile" -- cgit v1.2.3