Merge pull request #735 from imomaliev/master

[#734] tmux-completion when trying to use withiout running server
pull/737/head
Nils Winkler 2016-06-01 09:43:49 +02:00
commit d379760041
1 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ function _tmux_complete_window() {
sessions="$(tmux -q list-sessions 2>/dev/null | sed -re 's/([^:]+:).*$/\1/')" sessions="$(tmux -q list-sessions 2>/dev/null | sed -re 's/([^:]+:).*$/\1/')"
if [[ -n "${session_name}" ]]; then if [[ -n "${session_name}" ]]; then
sessions="${sessions} sessions="${sessions}
$(tmux -q list-windows -t "${session_name}" 2>/dev/null | sed -re 's/^([^:]+):.*$/'"${session_name}"':\1/')" $(tmux -q list-windows -t "${session_name}" 2>/dev/null | sed -re 's/^([^:]+):.*$/'"${session_name}"':\1/')"
fi fi
cur="$(echo "${cur}" | sed -e 's/:/\\\\:/')" cur="$(echo "${cur}" | sed -e 's/:/\\\\:/')"
sessions="$(echo "${sessions}" | sed -e 's/:/\\\\:/')" sessions="$(echo "${sessions}" | sed -e 's/:/\\\\:/')"
@ -102,7 +102,7 @@ _tmux() {
if [[ $COMP_CWORD -le $cmd_index ]]; then if [[ $COMP_CWORD -le $cmd_index ]]; then
# The user has not specified a command yet # The user has not specified a command yet
COMPREPLY=( ${COMPREPLY[@]:-} $(compgen -W "$(tmux list-commands | cut -d' ' -f1)" -- "${cur}") ) COMPREPLY=( ${COMPREPLY[@]:-} $(compgen -W "$(tmux start-server \; list-commands | cut -d' ' -f1)" -- "${cur}") )
else else
case ${cmd} in case ${cmd} in
attach-session|attach) attach-session|attach)