Bash completion of flags not working in Trusty

Bug #1460165 reported by Cindy Quach
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
bash-completion (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

On the previous version of bash completion for Precise (bash-completion v1:1.3-1ubuntu8.1) I was able to use tab completion for filenames passed into commands as flags. In the current version in Trusty this functionality is missing.

1. Release version:
Description: Ubuntu 14.04.1 LTS
Release: 14.04

2. Package version:
bash-completion 1:2.1-4

3. What you expected to happen
some_executable --file=/etc/h<TAB> should autocomplete to /etc/hosts

4. What happened instead.
Tab completion does not work for filenames passed into commands as flags

Tags: trusty
Mathew Hodson (mhodson)
tags: added: trusty
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in bash-completion (Ubuntu):
status: New → Confirmed
Revision history for this message
Margarita Manterola (marga-9) wrote :

The issue depends on the command and the flags. For example, if I do:

marga@balerion:~$ pbuilder --basetgz=/var/<TAB>
backups/ crash/ local/ log/ metrics/ run/ tmp/
cache/ lib/ lock/ mail/ opt/ spool/

This works correctly, I guess because in the bash completion for this command it's set that --basetgz wants path completion.

However, if I do:
marga@balerion:~$ pdebuild -- --basetgz=/var<TAB>

Nothing happens, because this is not specified in the bash completion. Before, when a flag was not specified, it completed nonetheless, now if it's not specified, it doesn't complete. This puts a big burden on each command providing the necessary bash completion in order to complete paths with tabs which feels like the wrong way to go.

I can reproduce this also with the version in Debian testing (1:2.1-4.2), so it's not confined to trusty.

Revision history for this message
Margarita Manterola (marga-9) wrote :

Found this: http://stackoverflow.com/questions/20365372/bash-completion-for-path-in-argument-with-equals-sign-present, where someone complains about this same problem and then they claim it was a broken completion script in their config. I moved away both the /etc/bash_completion.d/ and /usr/share/bash-completion/completions directories, to remove all completions installed in the system, and I still was able to reproduce the problem.

There's also the "complete" bash builtin, which establishes the behavior per command and for the default. However, changing the default as mentioned in one of the answers didn't fix the problem for me (not even after having removed all completions).

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.