Files
dotfiles/scripts/scripts/ts

15 lines
397 B
Bash
Executable File

#!/bin/sh
session=${1}
if [ -z "$session" ]; then
session=$(tmux list-sessions -F \#S | gum filter --placeholder "Pick a session...")
tmux switch-client -t "$session" || tmux attach -t "$session"
else
if [ ! -z "$(tmux list-sessions -F \#S | grep $session)" ]; then
tmux switch-client -t "$session" || tmux attach -t "$session"
else
echo "No session found for: $session"
fi
fi