mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 06:12:34 +00:00
15 lines
397 B
Bash
Executable File
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
|