I have a function that is basically a wrapper around a tmux subcommand:
function tma() {
tmux attach-session -t $1 || tmux new-session -s $1
}
I would like zsh to autocomplete with any open sessions that may exists as it currently does if I type tmux attach-session -t
and start tabbing. I've tried
compdef tma=tmux
which understandably tries to autocomplete to tmux subcommands and
compdef tma=tmux attach-session -t
which gives the error message compdef: unknown command or service: tmux attach-session -t
.
Is this possible?