Skip to content

Instantly share code, notes, and snippets.

@mcfiredrill
Created January 24, 2013 01:18
Show Gist options
  • Save mcfiredrill/4616668 to your computer and use it in GitHub Desktop.
Save mcfiredrill/4616668 to your computer and use it in GitHub Desktop.
simple tmux bash completion
# completion for tmux session names
function _tmux_complete_session() {
local cur
cur="${COMP_WORDS[COMP_CWORD]}"
COMPREPLY=( $(compgen -W "$(tmux ls | cut -f 1 -d ':')" -- "${cur}") )
}
alias td='tmux a -d -t'
complete -F _tmux_complete_session td
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment