Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tab completion function for catkin_make seems to be broken #485

Closed
ablasdel opened this issue Jul 22, 2013 · 9 comments
Closed

Tab completion function for catkin_make seems to be broken #485

ablasdel opened this issue Jul 22, 2013 · 9 comments
Assignees
Labels

Comments

@ablasdel
Copy link

When attempting a tab complete I get "_init_completion: command not found"
Is it supposed to be tab completing the possible inputs?

@dirk-thomas
Copy link
Member

Yes it should and it does for me.

Can you please describe which version of catkin you have installed and how you source the ROS environment?

@ablasdel
Copy link
Author

Yes I am sourcing /opt/ros/groovy/setup.bash
before building any catkin package

dpkg -l -> ii ros-groovy-catkin 0.5.71-0precise-20130721-1548-+0000 Low-level build system macros and infrastructure for ROS.

@dirk-thomas
Copy link
Member

It might be related to the versions of your installed packages of bash or bash-completion. Can you check those?

Which version of Ubuntu are you running?

@ablasdel
Copy link
Author

ii bash 4.2-2ubuntu2.1 GNU Bourne Again SHell
ii bash-completion 1:1.3-1ubuntu8.1 programmable completion for the bash shell

a dist-upgrade doesn't seem to find anything though

as for version:
Distributor ID: Ubuntu
Description: Ubuntu 12.04.2 LTS
Release: 12.04
Codename: precise

@dirk-thomas
Copy link
Member

The reason seems to be the pretty old version of bash-completion. Quantal ships with 2.0 and your version does not contain that function (http://anonscm.debian.org/gitweb/?p=bash-completion/bash-completion.git;a=commitdiff;h=32dbe76784acc39b17ee9ca7bc21c28f4f2b23b5).

You could try to remove the function call from /opt/ros/groovy/etc/catkin/profile.d/05.catkin_make.bash and see if that help.

@ablasdel
Copy link
Author

commenting out the "_init_completion -s || return" line solved the problem for me

@ablasdel
Copy link
Author

If I source the setup.bash in devel the problem comes back since we are using the generated one.

Would using something like this work?

    if type -t _init_completion | grep -q '^function$'; then
        _init_completion -s || return
    fi

@dirk-thomas
Copy link
Member

Can you please verify that replacing the line

_init_completion -s || return

with this

cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}

will make it work for you with older bash completion? Please test completion of options starting with - as well as target names (after having the workspace build at least once before).

@ablasdel
Copy link
Author

Looks like it functions correctly. both catkin_make *tab* and catkin_make -*tab* give me completion lists with this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants