From 9b866fa93cc51493d14257f30b3713896a13fa4d Mon Sep 17 00:00:00 2001 From: Jon Schewe Date: Sun, 12 Feb 2012 12:30:07 -0600 Subject: [PATCH] Found another function that needs to be copied to tmux completion --- completion/available/tmux.completion.bash | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/completion/available/tmux.completion.bash b/completion/available/tmux.completion.bash index ca06d83..87008a3 100644 --- a/completion/available/tmux.completion.bash +++ b/completion/available/tmux.completion.bash @@ -3,11 +3,25 @@ # Usage: Put "source bash_completion_tmux.sh" into your .bashrc # Based upon the example at http://paste-it.appspot.com/Pj4mLycDE +_tmux_expand () +{ + [ "$cur" != "${cur%\\}" ] && cur="$cur"'\'; + if [[ "$cur" == \~*/* ]]; then + eval cur=$cur; + else + if [[ "$cur" == \~* ]]; then + cur=${cur#\~}; + COMPREPLY=($( compgen -P '~' -u $cur )); + return ${#COMPREPLY[@]}; + fi; + fi +} + _tmux_filedir () { local IFS=' '; - _expand || return 0; + _tmux_expand || return 0; if [ "$1" = -d ]; then COMPREPLY=(${COMPREPLY[@]} $( compgen -d -- $cur )); return 0; -- 2.17.1