1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-05-20 02:43:23 -07:00

handle tmux sessions better

This commit is contained in:
Connor Olding 2019-06-05 16:51:30 -07:00
parent e627d7d22a
commit bc1758f51e

View File

@ -1,7 +1,8 @@
[ -e /etc/profile ] && emulate sh -c "source /etc/profile"
if [ "$SHLVL" -le 1 ] && ! expr "$TERM" : screen >/dev/null; then
if which tmux >/dev/null 2>/dev/null; then
tmux attach || tmux && exit
# create a new session called "what" or attach if it already exists
tmux new -A -s what && exit
echo "tmux died ($?), continuing..."
fi
fi