diff --git a/.agents/skills/lib.sh b/.agents/skills/lib.sh index 3ef014f..2e87094 100644 --- a/.agents/skills/lib.sh +++ b/.agents/skills/lib.sh @@ -1591,7 +1591,7 @@ send_keys_safe() { # lines at the terminal width (and some TUIs add indentation on the # continuation line too), which can split/reformat the marker across two # visual lines and make a literal grep miss it even though the paste landed. - elif ! printf '%s' "$pane_content" | tr -d '[:space:]' | grep -Fq "$marker_norm"; then + elif [ -n "$marker_norm" ] && ! printf '%s' "$pane_content" | tr -d '[:space:]' | grep -Fq "$marker_norm"; then echo "send_keys_safe: paste not visible ($sess)" >&2 return 3 fi @@ -1606,7 +1606,7 @@ send_keys_safe() { if printf '%s\n' "$cur_content" | grep -Eq "● |✽ |[A-Za-z]+ing…|[A-Za-z]+ing\.\.\.|esc to interrupt"; then return 0 fi - if [ "$was_popup" = "0" ] && ! _pane_tail "$sess" 3 | tr -d '[:space:]' | grep -Fq "$marker_norm" && [ "$cur_content" != "$pre_submit" ]; then + if [ "$was_popup" = "0" ] && { [ -z "$marker_norm" ] || ! _pane_tail "$sess" 3 | tr -d '[:space:]' | grep -Fq "$marker_norm"; } && [ "$cur_content" != "$pre_submit" ]; then return 0 elif [ "$was_popup" = "1" ] && \ ! printf '%s\n' "$cur_content" | grep -Eq "Pasted text|paste again to expand" && \