On Tue, Dec 28, 2021 at 11:19 AM Daniel Sahlberg <daniel.l.sahlb...@gmail.com> wrote: > > Hi, > > While digging through Jira I stumbled upon the above mentioned issue. > > It seems fairly simple to add the -o bashdefault option when defining the > completion. > > Patch attached, anyone want to comment before I commit? > > Kind regards, > Daniel
Interesting! I'm not an expert on bash completion but I tried the patch and I can confirm it seems to enable this functionality on my system. I am slightly worried, though, that "-o bashdefault" might be a bashism not compatible with all systems or shells. Since the bug report mentioned git and mplayer, I perused the completion scripts for those programs on my debian box to see what they're doing. Strangely the mplayer one didn't seem to have either "-o bashdefault" or "-o default", but it contains a lot of logic I haven't tried to grok; meanwhile the git one, also with a great deal of other logic I haven't tried to grok, seems to try using both options together "-o bashdefault -o default" and, if that fails, tries with just "-o default", like this: complete -o bashdefault -o default -o nospace -F $wrapper $1 2>/dev/null || complete -o default -o nospace -F $wrapper $1 Cheers, Nathan