lincheney / fzf-tab-completion

Tab completion using fzf
GNU General Public License v3.0
623 stars 40 forks source link

space after tab completing sole item #101

Closed kaddkaka closed 3 months ago

kaddkaka commented 4 months ago

regular bash completion inserts a space after TAB completing when there is only one match

This script does:

Proposal: insert a space like bash regular completion does.

d-enk commented 4 months ago

Please show output complete | grep git

kaddkaka commented 4 months ago

I have this:

$ complete | grep git
complete -o bashdefault -o default -o nospace -F __git_wrap__gitk_main gitk
complete -o bashdefault -o default -o nospace -F __git_wrap__git_main git
$

and in some terminals I also see this empty:

$ complete | grep git
$

The described behavior occurs in both cases.

kaddkaka commented 4 months ago

Oh, for other commands like cat I do get a space inserted after completing the only filename matching.

For example if the only file in current is README, then cat R<tab> -> cat README which is desired behavior.

So perhaps this is a cross issue with git completion

d-enk commented 4 months ago

remove -o nospace

just exec complete -o bashdefault -o default -F __git_wrap__git_main git

lincheney commented 4 months ago

git completion in bash inserts its own spaces, it should work even with nospace I think this is a bug I've introduced somewhere.

lincheney commented 4 months ago

Should be fixed in ff97a3c398e0163194ac1dfea9a4fb7e039c10f1

kaddkaka commented 4 months ago

Works on my other environment at least, thanks :+1: