diff --git a/utilities/utilities.plugin.zsh b/utilities/utilities.plugin.zsh index eeaf665..aacc0ff 100644 --- a/utilities/utilities.plugin.zsh +++ b/utilities/utilities.plugin.zsh @@ -15,12 +15,29 @@ elif which xclip &> /dev/null; then fi # Abstract different ways to paste from the clipboard. +# TODO: Use OSC-52 to get the clipboard, not widely supported though if [ "`uname`" = "Darwin" ]; then + # Use pbpaste to get the clipboard alias paste='pbpaste' elif which xclip &> /dev/null; then + # Use xclip to get the clipboard alias paste='xclip -selection c -o' fi +# Passthrough an escape sequences tmux doesn't know about. +tmux-dcs-passthrough() { + if [ -n "$TMUX" ]; then + printf "\x1bPtmux;\x1b$1\x1b\\" + else + printf "$1" + fi +} + +# OSC 9 - Post a notification - supported by iTerm2, maybe others? +notify() { + tmux-dcs-passthrough "\x1b]9;$*\x7" +} + # Detect the type and extract an archive file. extract() { if [ -f $1 ]; then