diff --git a/bashrc b/bashrc index b3c7aa8..13bb920 100644 --- a/bashrc +++ b/bashrc @@ -1,3 +1,4 @@ +source ~/.starttmux # If not running interactively, don't do anything [ -z "$PS1" ] && return @@ -174,16 +175,6 @@ PS0="$PS0 \\[\033[1;32m\]\$(parse_git_branch)\\[\033[0m\]\$ " export PATH=$PATH:"/media/Data/code/personal-scripts/" export CDPATH=$CDPATH:"/media/Data/" -# TMUX -if which tmux 2>&1 >/dev/null; then - # if no session is started, start a new session - test -z ${TMUX} && tmux attach - # when quitting tmux, try to attach - if test -z ${TMUX}; then - exit; - fi -fi - PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting ### Added by the Heroku Toolbelt diff --git a/oh-my-zsh b/oh-my-zsh index 2c3489a..9de171c 160000 --- a/oh-my-zsh +++ b/oh-my-zsh @@ -1 +1 @@ -Subproject commit 2c3489a75014f80c87ee6c6ae6ab62251dd684b0 +Subproject commit 9de171c0217bf9a50b9a091d56a13cf27b1fbb82 diff --git a/starttmux b/starttmux new file mode 100644 index 0000000..00d8063 --- /dev/null +++ b/starttmux @@ -0,0 +1,16 @@ +# TMUX +# if [[ -z "$KONSOLE_DBUS_SERVICE" & `which tmux` ]]; then +# if no session is started, start a new session +if [[ -n $(which tmux) ]]; then + stty -ixon + if [ ! -z "$SSH_AUTH_SOCK" -a "$SSH_AUTH_SOCK" != "$HOME/.ssh/ssh_auth_sock" ] ; then + unlink "$HOME/.ssh/ssh_auth_sock" 2>/dev/null + ln -s "$SSH_AUTH_SOCK" "$HOME/.ssh/ssh_auth_sock" + export SSH_AUTH_SOCK="$HOME/.ssh/ssh_auth_sock" + fi + test -z ${TMUX} && tmux attach + # when quitting tmux, try to attach + if [[ -z ${TMUX} ]]; then + exit; + fi +fi diff --git a/zshrc b/zshrc index fd4f5e8..404a665 100644 --- a/zshrc +++ b/zshrc @@ -1,3 +1,4 @@ +source ~/.starttmux # Path to your oh-my-zsh configuration. ZSH=$HOME/.oh-my-zsh @@ -44,17 +45,6 @@ export PATH=/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/u PYTHONSTARTUP=~/.pythonrc.py export PYTHONSTARTUP -# TMUX -# if [[ -z "$KONSOLE_DBUS_SERVICE" & `which tmux` ]]; then -# if no session is started, start a new session -if [[ -z "$KONSOLE_DBUS_SERVICE" && -n $(which tmux) ]]; then - stty -ixon - test -z ${TMUX} && tmux attach - # when quitting tmux, try to attach - if [[ -z ${TMUX} ]]; then - exit; - fi -fi ### Added by the Heroku Toolbelt export PATH="/usr/local/heroku/bin:$PATH"