diff --git a/bash_completion b/bash_completion index 9b122cdeed3..ee78c185a7b 100644 --- a/bash_completion +++ b/bash_completion @@ -1727,9 +1727,11 @@ _comp_compgen_available_interfaces() if [[ ${1-} == -w ]]; then iwconfig elif [[ ${1-} == -a ]]; then - ifconfig || ip -c=never link show up || ip link show up + # long interface name may be truncated by ifconfig, prefer iproute2. + # See also: https://github.com/scop/bash-completion/issues/1089 + ip -c=never link show up || ip link show up || ifconfig else - ifconfig -a || ip -c=never link show || ip link show + ip -c=never link show || ip link show || ifconfig -a fi } 2>/dev/null | _comp_awk \ '/^[^ \t]/ { if ($1 ~ /^[0-9]+:/) { print $2 } else { print $1 } }')" &&