ajeetdsouza / zoxide

A smarter cd command. Supports all major shells.
MIT License
20.24k stars 517 forks source link

Autocompletion for fish is not working on my system #811

Open ChielTimmermans opened 1 month ago

ChielTimmermans commented 1 month ago

I am not sure if this feature is supported but looking through merged changes I am expecting that it would.

Currently I run zoxide with Fish on alacritty. It would be lovely if I could you tab to autocomplete the current word youŕe typing.

Could someone help me debug this issue?

rudenkornk commented 1 month ago

+1 on this
Completions do not work for me neither in fish nor bash. I see that zoxide init fish outputs among others __zoxide_z_complete, so I guess it should work?..


Update: Ok, I figured that out in my case. So, the way z autocompletes is that by default it uses normal cd completions. "Smart" completions are only enabled if two conditions are met:

  1. You entered your "guess" and a space after it
  2. Your guess has at least one candidate. If that is not true, z reports an error and that looks a bit weird in the terminal.
enolive commented 1 month ago

I think the autocompletion works, but not in the way cd autocompletion does, which is not compatible with my brain :disappointed:

for now I replaced the configured zoxide autocompletion with the one found in __fish_complete_cd: (note that use zoxide through fisher)

# replace zoxide autocompletion with the default one for cd as it does not meet my expectations right now
complete -e $zoxide_cmd
complete -c $zoxide_cmd -a '(__fish_complete_cd)'
bs10x commented 1 month ago

same for me. this has been driving me crazy for months.

vasi786 commented 1 month ago

same for me on bash.

mahume commented 6 days ago

Same here. Everything works on my zsh shell setup. Recently switched to fish shell. Using --cmd cd seems half baked. It'll take you there. However, it doesn't autocomplete and the argv[1] to the command shows as red as if not recognized.

image