Merge pull request #1 from ofirgall/master

[Bug Fix] scanning all history, escaping prompty with quotes
This commit is contained in:
artem avetisyan 2022-02-23 09:49:07 +01:00 committed by GitHub
commit bfd0f897b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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