scanning all history, escaping prompty with quotes

This commit is contained in:
Ofir Gal 2022-02-22 21:46:25 +02:00
parent 64d3f9e533
commit 9aabd12664

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash
x=$(tmux capture-pane -p -J -t !)
x=$(tmux capture-pane -p -S '-' -J -t !)
readarray -t pane_contents <<<"$x"
# reverse loop through pane contents lines
@ -10,7 +10,7 @@ for (( idx=${#pane_contents[@]}-2 ; idx>=0 ; idx-- )) ; do
# strip trailing whitespace from line
line=$(sed 's/[[:space:]]*$//' <<<"$line")
if [[ $line =~ $PROMPT_PATTERN ]]; then
if [[ $line =~ "$PROMPT_PATTERN" ]]; then
break
fi