Skip to content

Commit

Permalink
fix(tmux): Alias functions break zsh completion
Browse files Browse the repository at this point in the history
  • Loading branch information
detroyejr committed Mar 11, 2024
1 parent 4fd2af0 commit ee63956
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions plugins/tmux/tmux.plugin.zsh
Expand Up @@ -57,6 +57,14 @@ function _build_tmux_alias {
}"
}

function _session_completion {
local sessions
sessions=(${(f)"$(tmux list-session)"})

_alternative \
'commands:: _describe -t sessions "tmux session" sessions'
}

alias tksv='tmux kill-server'
alias tl='tmux list-sessions'
alias tmuxconf='$EDITOR $ZSH_TMUX_CONFIG'
Expand Down Expand Up @@ -130,6 +138,10 @@ function _zsh_tmux_plugin_run() {

# Use the completions for tmux for our function
compdef _tmux _zsh_tmux_plugin_run

# Provide session name completion for alias functions.
compdef _session_completion ta tad tkss

# Alias tmux to our wrapper function.
alias tmux=_zsh_tmux_plugin_run

Expand Down

0 comments on commit ee63956

Please sign in to comment.