npm package breaks bash completion

Bug #1211104 reported by Ben Davis
22
This bug affects 5 people
Affects Status Importance Assigned to Milestone
npm (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

The /etc/bash_completion.d/npm file breaks bash completion. Tested in Ubuntu 12.10 and 13.04. I reproduced this on a fresh install of 13.04. Basically what happens is when you try to complete a command that has an argument/flag that accepts a filename, it completes the filename but removes the entire argument. For example, tab-completing "grep --exclude-dir=/ho" becomes "grep /home". Same with other commands such as dd.

Steps to reproduce:

$ sudo apt-get install npm
$ bash
$ grep --exclude-dir=/ho<tab>
$ dd if=/ho<tab>

You'll see that when you try to tab-complete those commands for the /home dir, it removes the previous argument.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in npm (Ubuntu):
status: New → Confirmed
Revision history for this message
Ian Schneider (planablediglet) wrote :

Since it took me a while to track this down, I'll share the actual source of the problem - the completion script removes the '=' character from COMP_WORDBREAKS

COMP_WORDBREAKS=${COMP_WORDBREAKS/=/}

Revision history for this message
Stefan Fleischmann (sfleischmann) wrote :

This bug is still present (Ubuntu 14.04, 14.10 and 15.04).

Upstream bug report: https://github.com/npm/npm/issues/4530

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.