function zmx-select --description "Fuzzy-find or create a zmx session" if not type -q zmx echo "zmx-select: zmx is not installed or not on PATH" >&2 return 127 end set -l session_name (zmx list 2>/dev/null | __zmx_format_sessions | __zmx_choose_session --preview 'zmx history {1}') or return $status zmx attach $session_name end