# HG changeset patch # User Oleksandr Gavenko # Date 1702247240 -7200 # Node ID b386e087b97f93c8617638a9fe64a9ef201280c4 # Parent 5b1ba85724fd89885d797f3df0f6e01994543162 Added workaround for Cygwin, npm authors explicitly forbids it: npm/lib/commands/completion.js if (isWindowsShell) { const msg = 'npm completion supported only in MINGW / Git bash on Windows' throw Object.assign(new Error(msg), { diff -r 5b1ba85724fd -r b386e087b97f .local/share/bash-completion/completions/npm --- a/.local/share/bash-completion/completions/npm Sun Dec 10 23:43:58 2023 +0200 +++ b/.local/share/bash-completion/completions/npm Mon Dec 11 00:27:20 2023 +0200 @@ -1,1 +1,9 @@ -eval "$(npm completion)" +if [[ $OSTYPE = cygwin ]]; then + # eval "$(MSYSTEM=MINGW64 npm completion | tr -d $'\r')" + _npm_completion () { + IFS=$'\n' COMPREPLY=( $(MSYSTEM=MINGW64 COMP_CWORD="$COMP_CWORD" COMP_LINE="$COMP_LINE" COMP_POINT="$COMP_POINT" npm completion -- "${COMP_WORDS[@]}" 2>/dev/null) ) + } + complete -o default -F _npm_completion npm +else + eval "$(npm completion)" +fi