Last active
May 15, 2019 10:29
-
-
Save pastak/8223238b0c46fcc82db6 to your computer and use it in GitHub Desktop.
tmux-bpcopy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if ! type pbcopy >/dev/null 2>&1 || ! type reattach-to-user-namespace >/dev/null 2>&1; then | |
tmux display-message "Error: cannot copy to clipboard." | |
exit 0 | |
fi | |
COPY=$(tmux save-buffer -) | |
echo "$COPY" | ghead -c -1 | reattach-to-user-namespace pbcopy | |
# メッセージ表示 | |
LINES=$(echo "$COPY" | wc -l | tr -d ' ') | |
tmux display-message "Copy: $LINES lines" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment