enhancd icon indicating copy to clipboard operation
enhancd copied to clipboard

tab completion not working

Open chevdor opened this issue 1 year ago • 9 comments

What did you expect to happen?

cd <tab> should work

What actually happened?

cd <tab> does not trigger expansion/autocompletion.

Output

  • cd <TAB> shows a -
  • cd M<TAB> (should suggest some hits like Movies, Music, etc...) shows nothing

Additional context

  • I am using zsh
  • other commands, such as ls do expand fine with tab
  • \cd does expand fine with tab
  • cd is aliased to cd=__enhancd::cd
  • unalias cd "fixes" the issue but well.. that's not the idea :)

I did run a zi update:

...
Updating: b4b4r07/enhancd
* b911969 - (tag: v2.5.1, origin/master, origin/HEAD) Release for v2.5.1 (#203) (2023-04-11) <github-actions[bot]>
* ...

chevdor avatar Apr 12 '23 12:04 chevdor

Same. I can repro in the both iTerm/Terminal app.

ghost avatar Apr 16 '23 08:04 ghost

I can confirm that completion for file system structures stopped working. I tried to disable all other plugins that might conflict (e.g. Aloxaf/fzf-tab), but without success. @b4b4r07 Please let me know which information is required in order to help to debug this. As a maintainer I know that it is not easy to reproduce such problems without the necessary information so feel free to ask for whatever is needed.

svengreb avatar Apr 22 '23 09:04 svengreb

I have also confirmed the same issue.

My solution was to comment out the line zi light b4b4r07/enhancd.

Additionally, I cloned the repository under ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/.zi/plugins. I reverted back to April 1st (commit: d224672), which was the last version I had previously used.

$ cd ${HOME}/.zi/plugins
$ git clone https://github.com/b4b4r07/enhancd.git
$ git checkout d224672

FYI: environment

  • OS: macOS Ventura version 13.4
  • ZSH: zsh 5.9 (x86_64-apple-darwin22.0)

GotoRen avatar May 19 '23 18:05 GotoRen

Downgrading can work as a temporary workaround, but lagging behind forever is actually not a permanent option. After digging into the changes in this repository I guess I found the simple “root cause“ of missing cd auto-completions: …it was intentionally removed in #191.

I've played around with my configurations and simply deferring the loading of the plugin (I use zplug to manage my ZSH plugins) with the defer: 2 zplug tag makes auto-completion working again. This way the zsh-users/zsh-completions plugin gets loaded before which provides the “native“ cd auto-completion. So in the end this is the way how my configuration line for enhancd looks like:

zplug "b4b4r07/enhancd", use:init.sh, defer:2

svengreb avatar May 20 '23 09:05 svengreb

@svengreb could you share you dotfiles? I've been trying to get cd completion back to work but just defering does not work for me? Do you have zsh-users/zsh-completions installed via zplug or via your package manager such as homebrew?

felipesere avatar May 21 '23 09:05 felipesere

Same issue here. Tried to defer with

zinit ice wait"2"
zinit light b4b4r07/enhancd

but no dice.

cocoonkid avatar May 29 '23 15:05 cocoonkid

@b4b4r07 I hope you're doing great and apology for directly pinging you but your comment would be highly appreciated.

cocoonkid avatar May 30 '23 08:05 cocoonkid

I'm also experiencing this. I hadn't updated enhancd in probably years and did so today and found that this is broken. Happy to help troubleshoot this.

blaenk avatar Aug 03 '23 05:08 blaenk

@b4b4r07 Thank you for your great tool that significantly improves my terminal experience!

I also encountered the same issue. Although I don't understand the cause of why we get - when tab completion is not set in zsh, I've found a workaround. Install changyuheng/zsh-interactive-cd (as suggested in #191). Below, I've pasted my git log output for both enhancd and zsh-interactive-cd, which work fine in my local environment.

 soya-miyoshi$ ~/.local/share/zinit/plugins/b4b4r07---enhancd (master %=)
$ git log
commit 230695f8da8463b18121f58d748851a67be19a00 (HEAD -> master, origin/master, origin/HEAD)
Author: Tim Feeley <[email protected]>
Date:   Wed Jun 28 18:16:33 2023 -0700

    Update README.md to fix typo in FZF_CTRL_T_COMMAND (#213)
 soya-miyoshi$ ~/.local/share/zinit/plugins/changyuheng---zsh-interactive-cd (master %=)
$ git log
commit e7d4802aa526ec069dafec6709549f4344ce9d4a (HEAD -> master, origin/master, origin/HEAD)
Merge: 7bbe02e 0b97cf5
Author: Johann Chang <[email protected]>
Date:   Tue Jul 26 10:41:26 2022 +0800

    Merge pull request #19 from brendanfalk/fig

    Add Fig as an installation method

And my zinit,

zinit ice wait lucid blockf
zinit light changyuheng/zsh-interactive-cd

zinit ice wait lucid blockf
zinit light 'b4b4r07/enhancd'

soya-miyoshi avatar Aug 14 '23 05:08 soya-miyoshi