theniceboy/zsh/tmux.zsh
2020-03-04 22:48:38 -08:00

15 lines
423 B
Bash

tmux_preexec() {
local tmux_event=${TMUX%%,*}-event/client-attached-pane
if [[ -f $tmux_event-$TMUX_PANE ]]; then
eval $(tmux showenv -s)
command rm $tmux_event-$TMUX_PANE 2>/dev/null
fi
}
if [[ -n $TMUX ]]; then
local tmux_event=${TMUX%%,*}-event/client-attached-pane
command rm $tmux_event-$TMUX_PANE 2>/dev/null
autoload -U add-zsh-hook
add-zsh-hook preexec tmux_preexec
fi