sio / bash-complete-partial-path

Enhanced file path completion in bash (like in zsh)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Do not change readline configuration

marcelpaulo opened this issue · comments

If you allow me a suggestion, do not change readline configuration. Those changes don't seem to be required for partial completion to work, even though, as you commented, they may provide a "better user experience". They're sensible changes, but they may disrupt what one is used to about readline.

For instance, I don't like to have menu-complete bound to TAB, I prefer complete, with set show-all-if-ambiguous on. So, after I tried partial completion for the first time, my first reaction was: hey, this is really great, but why the list of possible completions is not shown anymore ?!. I then looked at your code, and saw that you changed readline configuration. But then again, this is my personal preference.

Changing readline configuration from bash_completion may be a beneficial or a disruptive side effect, depending on how one uses readline. But it will be a side effect.

IMO, I would remove it from bash_completion, and suggest them in the installation instructions.

I was checking my ~/.inputrc, and found out that I have all your settings but these:

bind 'TAB:menu-complete'                                                                                                                                                                          
bind 'set menu-complete-display-prefix on'                                                                                                                                                        

Exactly the ones related to menu-complete.

It's a really useful project you have started, my congratulations.

I think I'll move the recommended (but optional) settings into a separate function that doesn't get called by default

Excellent idea, I hadn't thought of that.

I have moved all sourcing side effects into the _bcpp manager function.

Now sourcing the script does not introduce any changes to bash or readline behavior. Most users should use _bcpp --defaults to enable the completion and those who want a custom feature set should refer to _bcpp --help

@marcelpaulo, thank you for the idea! Your set of flags will probably be something like --files --dirs --override --nocase plus maybe --readline-color and/or --readline-misc

I'm impressed by what you implemented: it's better than what I initially imagined, by very far ! You really made life easy for the users of your software.

thank you for the idea

The idea and merit is all yours !