addet auto attatch to session

This commit is contained in:
piecka 2025-06-04 14:27:38 +02:00
parent bd0d677436
commit 5078064264

View file

@ -516,6 +516,15 @@ fi
# Tmux session manager
if command_exists tmux; then
if [ -z "$TMUX" ]; then
# Attach to existing session if any, otherwise create one named 'main'
if tmux ls &>/dev/null; then
tmux attach-session
else
tmux new-session
fi
fi
ta() {
if tmux list-sessions >/dev/null 2>&1; then
echo "-- tmux session active! | Connecting to active session --"