#!/bin/sh if [ "$TMUX" ]; then FZF="fzf --popup=bottom" else FZF="fzf" fi SESSION=$(tmux list-sessions | awk -F: '{ print $1 }' | $FZF --reverse) if [ -z "$SESSION" ]; then exit 0 fi if [ -z "$TMUX" ]; then tmux attach -t $SESSION else tmux switch-client -t $SESSION fi