Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interactive mode (space + tab) doesn't appear to be working on macOS #778

Closed
ThijmenDam opened this issue Apr 1, 2024 · 9 comments
Closed

Comments

@ThijmenDam
Copy link

ThijmenDam commented Apr 1, 2024

I have trouble getting the interactive mode to work using the space + tab keyboard shortcut.

For instance, consider the command z <some-dir> followed by a tab. Instead of going into interactive mode, my terminal shows the files/directories under the z <some-dir> command as if I had typed the ls command:

z <some-dir>
dir1 dir2 dir3

I have installed zoxide and fzf according to their installation instructions, i.e. my ~/.zshrc file ends with the following two lines:

eval "$(fzf --zsh)"
eval "$(zoxide init zsh)"

I use a fresh install of macOS 14.4.1.

Does anybody else experience this issue?

@ashleybartlett
Copy link
Contributor

I had also reported this, and think i've found the fix #785

@ajeetdsouza
Copy link
Owner

For instance, consider the command z followed by a tab.

z foo<Tab> will give you local directory completions. z foo<Space><Tab> will pull up interactive completions. Are you adding a <Space>?

Also, have you called compinit before initializing zoxide?

  • If compinit is not called, zoxide will not initialize completions
  • If compinit is called after zoxide, it will reset the completions for zoxide

@ajeetdsouza ajeetdsouza added the waiting-for-response Waiting for a response from the issue author. label Apr 19, 2024
@ThijmenDam
Copy link
Author

ThijmenDam commented Apr 19, 2024

Are you adding a space?

Yes, I use z foo<Space><Tab>

Also, have you called compinit before initializing zoxide?

Should I explicitly call this command in my ~/.zshrc file? Currently, the file looks like this:

eval "$(starship init zsh)"
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
eval "$(zoxide init zsh)"

Do you need any other information?

@github-actions github-actions bot removed the waiting-for-response Waiting for a response from the issue author. label Apr 19, 2024
@ajeetdsouza
Copy link
Owner

Should I explicitly call this command in my ~/.zshrc file?

Yup. Add this right at the start of your zshrc file:

autoload -Uz compinit
compinit

@ajeetdsouza ajeetdsouza added the waiting-for-response Waiting for a response from the issue author. label Apr 20, 2024
@ThijmenDam
Copy link
Author

Yup. Add this right at the start of your zshrc file:

autoload -Uz compinit
compinit

This has resolved the issue. Thank you very much for the support @ajeetdsouza!

@github-actions github-actions bot removed the waiting-for-response Waiting for a response from the issue author. label Apr 22, 2024
@HaskellZhangSong
Copy link

Same issue here, I just use normal oh my zsh, is it possible to use this SPC TAB trick? May I ask what your shell config is? @ThijmenDam

@ThijmenDam
Copy link
Author

ThijmenDam commented Jul 4, 2024

@HaskellZhangSong output of cat ~/.zshrc:

# necessary for z <path><space><tab> to work
autoload -Uz compinit
compinit

# Pytthon
if command -v pyenv 1>/dev/null 2>&1; then
  eval "$(pyenv init --path)"
fi

# ll command
alias ll='ls -la'

# NVM
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

eval "$(starship init zsh)"
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
eval "$(zoxide init zsh)"

@rome-legacy
Copy link

Hey guys,

same issue with bash on macOS Sonoma 14.7
but instead i use bash. is there a solution for that too?

regards
rome

@ajeetdsouza
Copy link
Owner

These are very likely problems specific to your setup, please create separate issues for these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants