_tmux_complete_session() {
  IFS="$(command -p -- printf -- ' \n|')" && export IFS="${IFS%'|'}"
  cur=${COMP_WORDS[COMP_CWORD]}

  COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W "$(tmux -q list-sessions | cut -f 1 -d ':')" -- "${cur}"))
}
complete -F _tmux_complete_session tm tma tmk
