mirror of
https://github.com/NixOS/nix
synced 2025-06-25 02:21:16 +02:00
fix: bash mangles flake ref completion
(cherry picked from commit 088fa815d3
)
This commit is contained in:
parent
e0c8b0fc4f
commit
ce5c0c64af
1 changed files with 9 additions and 2 deletions
|
@ -12,9 +12,16 @@ function _complete_nix {
|
||||||
elif [[ $completion == attrs ]]; then
|
elif [[ $completion == attrs ]]; then
|
||||||
compopt -o nospace
|
compopt -o nospace
|
||||||
fi
|
fi
|
||||||
else
|
continue
|
||||||
COMPREPLY+=("$completion")
|
|
||||||
fi
|
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)
|
done < <(NIX_GET_COMPLETIONS=$cword "${words[@]}" 2>/dev/null)
|
||||||
__ltrim_colon_completions "$cur"
|
__ltrim_colon_completions "$cur"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue