Skip to content

Commit

Permalink
Merge pull request NixOS#11240 from 0x5a4/fix-11208
Browse files Browse the repository at this point in the history
fix: bash mangles flake ref completion
  • Loading branch information
tomberek authored Aug 19, 2024
2 parents aeabe68 + 088fa81 commit b0a7edb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions misc/bash/completion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down

0 comments on commit b0a7edb

Please sign in to comment.