Unlike glibc, msys2-runtime does not seem to implement \w and \s. This replaces them with equivalent classes. --- a/scripts/completion/bash_completion.in +++ b/scripts/completion/bash_completion.in @@ -24,7 +24,7 @@ } _arch_incomp() { - local r="\s-(-${1#* }\s|\w*${1% *})"; [[ $COMP_LINE =~ $r ]] + local r="[[:space:]]-(-${1#* }[[:space:]]|[[:alnum:]_]*${1% *})"; [[ $COMP_LINE =~ $r ]] } _pacman_keyids() { @@ -74,7 +74,7 @@ local cur opts prev COMPREPLY=() _get_comp_words_by_ref cur prev - if [[ $cur = -* && ! $prev =~ ^-(-(config|help|key|version)$|\w*[Vhp]) ]]; then + if [[ $cur = -* && ! $prev =~ ^-(-(config|help|key|version)$|[[:alnum:]_]*[Vhp]) ]]; then opts=('allsource asdeps check clean cleanbuild config force geninteg help holdver ignorearch install key log needed noarchive nobuild nocheck nocolor noconfirm nodeps noextract noprepare noprogressbar nosign @@ -123,7 +123,7 @@ if [[ $? != 0 ]]; then _arch_ptr2comp core - elif [[ ! $prev =~ ^-\w*[Vbhr] && + elif [[ ! $prev =~ ^-[[:alnum:]_]*[Vbhr] && ! $prev = --@(cachedir|color|config|dbpath|help|hookdir|gpgdir|logfile|root|version) ]] then [[ $cur = -* ]] && _arch_ptr2comp ${o#* } common ||