mirror of
https://github.com/SinTan1729/tmux_copy_last_command_output.git
synced 2025-04-19 09:30:01 -05:00
Merge pull request #1 from ofirgall/master
[Bug Fix] scanning all history, escaping prompty with quotes
This commit is contained in:
commit
bfd0f897b3
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue