fix: add empty marker_norm guard in send_keys_safe to avoid always-true grep matches

This commit is contained in:
Antigravity
2026-07-20 10:41:47 +09:00
parent 087a294135
commit daa1476714
+2 -2
View File
@@ -1591,7 +1591,7 @@ send_keys_safe() {
# lines at the terminal width (and some TUIs add indentation on the # lines at the terminal width (and some TUIs add indentation on the
# continuation line too), which can split/reformat the marker across two # 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. # 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 echo "send_keys_safe: paste not visible ($sess)" >&2
return 3 return 3
fi 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 if printf '%s\n' "$cur_content" | grep -Eq "● |✽ |[A-Za-z]+ing…|[A-Za-z]+ing\.\.\.|esc to interrupt"; then
return 0 return 0
fi 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 return 0
elif [ "$was_popup" = "1" ] && \ elif [ "$was_popup" = "1" ] && \
! printf '%s\n' "$cur_content" | grep -Eq "Pasted text|paste again to expand" && \ ! printf '%s\n' "$cur_content" | grep -Eq "Pasted text|paste again to expand" && \