TMUX bash completion based on bash-it's tmux completion
- commands
- files
- sessions
- windows
Using bash-completion
This installation method requires bash-completion
1.2 or higher.
-
Follow the installation instructions for
bash-completion
-
Determine the correct spot to place this plugin.
From the bash-completion FAQ
Q. Where should I install my own local completions?
A. Put them in the completions subdir of
$BASH_COMPLETION_USER_DIR
(defaults to$XDG_DATA_HOME/bash-completion
or~/.local/share/bash-completion
if$XDG_DATA_HOME
is not set) to have them loaded automatically on demand when the respective command is being completed. See also the next question's answer for considerations for these files' names, they apply here as well. Alternatively, you can write them directly in~/.bash_completion
which is loaded eagerly by our main script.
$ dir="${BASH_COMPLETION_DIR:-"${XDG_DATA_HOME:-"$HOME/.local/share"}/bash-completion"}/completions"
$ mkdir -p "$dir"
- Download the file
$ curl -fSsL "https://raw.githubusercontent.com/imomaliev/tmux-bash-completion/master/completions/tmux" > "${dir?error: dir not set: you must run the previous commands first}/tmux"
- Reload your configuration files
$ source ~/.bashrc
You can simply download the completion file and source it as part of your shell startup.
$ curl -fSsL "https://raw.githubusercontent.com/imomaliev/tmux-bash-completion/master/completions/tmux" > ~/.bash.tmux-bash-completion
$ echo 'source ~/.bash.tmux-bash-completion' >> ~/.bashrc
$ source ~/.bashrc # load it for your current session
- use
list-sessions -F
- check all cases for
complete -o default