Turn on -o filenames in _tilde() only when it produces completions.
This commit is contained in:
parent
0042c06204
commit
e104424ff2
@ -852,10 +852,10 @@ _tilde()
|
|||||||
{
|
{
|
||||||
local result=0
|
local result=0
|
||||||
if [[ $1 == ~* && $1 != */* ]]; then
|
if [[ $1 == ~* && $1 != */* ]]; then
|
||||||
compopt -o filenames 2>/dev/null
|
|
||||||
# Try generate ~username completions
|
# Try generate ~username completions
|
||||||
COMPREPLY=( $( compgen -P '~' -u "${1#\~}" ) )
|
COMPREPLY=( $( compgen -P '~' -u "${1#\~}" ) )
|
||||||
result=${#COMPREPLY[@]}
|
result=${#COMPREPLY[@]}
|
||||||
|
[ $result -gt 0 ] && compopt -o filenames 2>/dev/null
|
||||||
fi
|
fi
|
||||||
return $result
|
return $result
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user