mirror of
https://github.com/SinTan1729/tmux_copy_last_command_output.git
synced 2025-04-11 14:16:03 -05:00
6 lines
212 B
Bash
Executable file
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
|