mirror of
https://github.com/SinTan1729/tmux_copy_last_command_output.git
synced 2025-04-19 09:30:01 -05:00
7 lines
212 B
Bash
Executable file
7 lines
212 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
x=$(tmux capture-pane -p -S '-')
|
|
PROMPT_PATTERN=${1:-' ) '}
|
|
result=$(echo "$x" | tac | sed -e "0,/$PROMPT_PATTERN/d" | sed "/$PROMPT_PATTERN/,\$d" | tac)
|
|
|
|
echo -n "$result" | xclip -sel clip
|