diff --git a/completions/bash/multipass b/completions/bash/multipass index fe5aa32716..6e9aa70e08 100644 --- a/completions/bash/multipass +++ b/completions/bash/multipass @@ -19,25 +19,11 @@ _multipass_complete() local state=$1 local cmd="multipass list --format=csv --no-ipv4" - [ -n "$state" ] && cmd="$cmd | \awk -F',' '\$2 == \"$state\"'" + [ -n "$state" ] && cmd="$cmd | \tail -n +2 | \awk -F',' '\$2 == \"$state\"'" - local instances=$( \eval $cmd | \tail -n +2 | \cut -d',' -f 1 ) + local instances=$( \eval $cmd | \cut -d',' -f 1 | \tr '\r\n' ' ') - local found - - _get_comp_words_by_ref -n := -w WORDS -i CWORD cur prev - for instance in $instances; do - found=0 - for ((i=2; i