sio / bash-complete-partial-path

Enhanced file path completion in bash (like in zsh)
Apache License 2.0
54 stars 2 forks source link

Do not change readline configuration #4

Closed marcelpaulo closed 6 years ago

marcelpaulo commented 6 years ago

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 _bashcompletion 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 _bashcompletion, and suggest them in the installation instructions.

marcelpaulo commented 6 years ago

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.

sio commented 6 years ago

I agree it's a valid suggestion. I think I'll move the recommended (but optional) settings into a separate function that doesn't get called by default.

That way it'll be easy to invoke (just one more line in bashrc) for those who want my defaults, yet not forced on anybody.

Unfortunately, I'm on vacation and will be at my computer after July, 30th. I'll get back to this issue then.

Thank you for your feedback! And thank you for taking an interest in this project

marcelpaulo commented 6 years ago

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.

sio commented 6 years ago

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

marcelpaulo commented 6 years ago

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 !