Skip to content
Browse files

add tmux specific script

  • Loading branch information...
1 parent d1337a8 commit f3072b20cae722f91ff9e6acb2ad89883bcaab4f @fkfk committed Mar 25, 2012
Showing with 16 additions and 0 deletions.
  1. +16 −0 .zsh/specific/tmux.zshrc
View
16 .zsh/specific/tmux.zshrc
@@ -0,0 +1,16 @@
+_LOADED_SPECIFIC_TMUX=1
+
+# tmux wrapper for Mac OSX
+# base: https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard
+if [[ ( $OSTYPE == darwin* ) && ( -x $(which tmux 2>/dev/null) ) && ( -x $(which reattach-to-user-namespace 2>/dev/null ) ) ]]; then
+ function tmuxx() {
+ case $# in
+ 0)
+ conf=$(cat $HOME/.tmux.conf <(echo 'set-option -g default-command "reattach-to-user-namespace -l $SHELL"'))
+ tmux attach || tmux -f <(echo "$conf") new-session
+ ;;
+ *) tmux $*;;
+ esac
+ }
+ alias tmux="tmuxx"
+fi

0 comments on commit f3072b2

Please sign in to comment.
Something went wrong with that request. Please try again.