tmux_copy_last_command_output/plugin.sh
2022-08-17 12:37:26 -05:00

6 lines
212 B
Bash
Executable file

#!/usr/bin/env bash
x=$(tmux capture-pane -p -S '-' -J -t !)
PROMPT_PATTERN=${1:-' ) '}
result=$(echo "$x" | tac | sed -e "0,/$PROMPT_PATTERN/d" | sed "/$PROMPT_PATTERN/,\$d" | tac)
echo -n "$result" | xsel -ib