1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 06:01:48 +02:00

Merge pull request #12211 from NixOS/mergify/bp/2.24-maintenance/pr-11240

fix: bash mangles flake ref completion (backport #11240)
This commit is contained in:
mergify[bot] 2025-01-10 23:43:24 +00:00 committed by GitHub
commit e1e219a299
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,9 +12,16 @@ function _complete_nix {
elif [[ $completion == attrs ]]; then
compopt -o nospace
fi
else
COMPREPLY+=("$completion")
continue
fi
if [[ "${cur}" =~ "=" ]]; then
# drop everything up to the first =. if a = is included, bash assumes this to be
# an arg=value argument and the completion gets mangled (see #11208)
completion="${completion#*=}"
fi
COMPREPLY+=("${completion}")
done < <(NIX_GET_COMPLETIONS=$cword "${words[@]}" 2>/dev/null)
__ltrim_colon_completions "$cur"
}