Skip to content
This repository has been archived by the owner on Oct 12, 2018. It is now read-only.

Default to normal completion #15

Open
polothy opened this issue Jan 20, 2012 · 7 comments
Open

Default to normal completion #15

polothy opened this issue Jan 20, 2012 · 7 comments

Comments

@polothy
Copy link

polothy commented Jan 20, 2012

Hi there,

I love this innovative bundle, thank you!

One thing though that I didn't like about the autocomplete though, is that once you started to autocomplete with files/directories, it wouldn't end the autocomplete with a forward slash, but rather with a space. This made if very difficult to autocomplete down a directory tree.

http://www.debian-administration.org/articles/317#comment_16

You can actually accomplish default autocompletion very easily. Just change your complete command from the above comment at the end of the bash script. You also need to "return 1" like so:

    if [[ ${COMP_CWORD} > 1 ]] ; then
        case "${cur}" in
            --*)
                COMPREPLY=( $(compgen -W "$(${cmd} autocomplete ${COMP_WORDS[1]})" -- ${cur}) )
                return 0
                ;;
            *)
                return 1
                ;;
        esac
    fi
@mbontemps
Copy link
Member

Great idea, could you do a Pull Request?

@stfalcon
Copy link
Contributor

@mrmark, I checked this solution and it don't work for me.

If I add "return 1" to symfony2-completion.bash
./app/console assets:install w[Tab] => ./app/console assets:install w (no result)

And default symfony2-completion.bash
./app/console assets:install w[Tab] => ./app/console assets:install web (dirname autocomplite)

@polothy
Copy link
Author

polothy commented Feb 21, 2012

You have to add the "return 1" and you must also add the "-o default" option to the complete commands like so:

complete -o default -F _console console 
complete -o default -F _console Symfony

Basically, the "return 1" tells the complete command to fallback to default bash completion (set with the "-o default").

Sorry, I don't think I made that all very clear in my report.

@stfalcon
Copy link
Contributor

wow! now it works fine
./app/console assets:install w[Tab] => ./app/console assets:install web/ (dirname autocomplite without space after dirname)

thank you ;)

could you do a Pull Request? this changes must be merged

@seydu
Copy link

seydu commented Mar 9, 2012

Great idea !
I installed it and it does the autocompletion in most cases. But when I do ./app/console cache:c[TAB] it does not complete and adds a 'TAB' (white space, ./app/console cache:c ) and does not display completion list as expected. It gets kind of 'hanged', I cannot use backspace key to delete anything. I am using Ubuntu 10.10.
I think the changes indicacted by @mrmark are already in the file I installed.

@stfalcon
Copy link
Contributor

stfalcon commented Mar 9, 2012

maybe
my pull request for this issue was merged #17

@seydu
Copy link

seydu commented Mar 10, 2012

I have compared.
The version I have includes your pull request. But it still behaves like what was described before your patch.

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

No branches or pull requests

4 participants