helm/shell/tmux/bin/tmux-session-name

8 lines
171 B
Plaintext
Raw Normal View History

#!/usr/bin/env bash
id=$(echo $TMUX | sed 's/.*,//g')
res=$(tmux ls -F '#{session_id}:#{session_name}' | grep -e "^\$$id:")
[[ -z $res ]] && exit 1
echo "${res#\$$id:}"