zoxide icon indicating copy to clipboard operation
zoxide copied to clipboard

Can't select interactive completions

Open CharlesARoy opened this issue 2 years ago • 3 comments

Hopefully I didn't miss a previous issue for this.

After installing zoxide with conda (and adding eval "$(zoxide init zsh)" to the bottom of my .zshrc file) I can't seem to select paths from the interactive completions. For example, after launching the interactive completions, I see: image

Then, if I hit enter on the second option, I get this: image

Not sure what I'm doing wrong... Please let me know if you need any specific system information.

CharlesARoy avatar Jan 20 '22 04:01 CharlesARoy

Are you able to select things with fzf?

ajeetdsouza avatar Jan 20 '22 06:01 ajeetdsouza

I'm not very familiar with fzf but if I run fzf -m, I can then scroll through the files that are returned and select any of them.

image

CharlesARoy avatar Jan 20 '22 17:01 CharlesARoy

I was using zsh-autocomplete but after removing it, I was able to select stuff normally with zoxide. These were my zsh-autocomplete settings prior to removing them (with the eval "$(zoxide init zsh)" command following this in my .zshrc file). If you use zsh-autocomplete, let me know if you spot any obvious issues with this setup.

# The code below sets all of `zsh-autocomplete`'s settings to their default
# values. To change a setting, copy it into your `.zshrc` file.

zstyle ':autocomplete:*' default-context ''
# '': Start each new command line with normal autocompletion.
# history-incremental-search-backward: Start in live history search mode.

zstyle ':autocomplete:*' min-delay 0.05  # float
# Wait this many seconds for typing to stop, before showing completions.

zstyle ':autocomplete:*' min-input 0  # int
# Wait until this many characters have been typed, before showing completions.

zstyle ':autocomplete:*' ignored-input '' # extended glob pattern
# '':     Always show completions.
# '..##': Don't show completions when the input consists of two or more dots.

zstyle ':autocomplete:*' list-lines 16  # int
# If there are fewer than this many lines below the prompt, move the prompt up
# to make room for showing this many lines of completions (approximately).

zstyle ':autocomplete:history-search:*' list-lines 16  # int
# Show this many history lines when pressing ↑.

zstyle ':autocomplete:history-incremental-search-*:*' list-lines 16  # int
# Show this many history lines when pressing ⌃R or ⌃S.

zstyle ':autocomplete:*' zoxide
# cdr:  Use Zsh's `cdr` function to show recent directories as completions.
# no:   Don't show recent directories.
# zsh-z|zoxide|z.lua|z.sh|autojump|fasd: Use this instead (if installed).
# ⚠️ NOTE: This setting can NOT be changed at runtime.

zstyle ':autocomplete:*' insert-unambiguous no
# no:  Tab inserts the top completion.
# yes: Tab first inserts a substring common to all listed completions, if any.

zstyle ':autocomplete:*' widget-style menu-select
# complete-word: (Shift-)Tab inserts the top (bottom) completion.
# menu-complete: Press again to cycle to next (previous) completion.
# menu-select:   Same as `menu-complete`, but updates selection in menu.
# ⚠️ NOTE: This setting can NOT be changed at runtime.

zstyle ':autocomplete:*' fzf-completion no
# no:  Tab uses Zsh's completion system only.
# yes: Tab first tries Fzf's completion, then falls back to Zsh's.
# ⚠️ NOTE: This setting can NOT be changed at runtime and requires that you
# have installed Fzf's shell extensions.

# Add a space after these completions:
zstyle ':autocomplete:*' add-space \
    executables aliases functions builtins reserved-words commands

source ~/tools/zsh-autocomplete/zsh-autocomplete.plugin.zsh

##
# NOTE: All configuration below should come AFTER sourcing zsh-autocomplete!
#

# Up arrow:
bindkey '\e[A' up-line-or-search
bindkey '\eOA' up-line-or-search
# up-line-or-search:  Open history menu.
# up-line-or-history: Cycle to previous history line.

# Down arrow:
bindkey '\e[B' down-line-or-select
bindkey '\eOB' down-line-or-select
# down-line-or-select:  Open completion menu.
# down-line-or-history: Cycle to next history line.

# Control-Space:
bindkey '\0' list-expand
# list-expand:      Reveal hidden completions.
# set-mark-command: Activate text selection.

# Uncomment the following lines to disable live history search:
# zle -A {.,}history-incremental-search-forward
# zle -A {.,}history-incremental-search-backward

# Return key in completion menu & history menu:
bindkey -M menuselect '\r' .accept-line
# .accept-line: Accept command line.
# accept-line:  Accept selection and exit menu.

CharlesARoy avatar Jan 20 '22 18:01 CharlesARoy

This issue has been fixed for me when I upgraded to v0.8.2

psibi avatar Aug 09 '22 09:08 psibi

Hey @CharlesARoy sorry this took so long, but #449 should fix this issue.

ajeetdsouza avatar Sep 05 '22 19:09 ajeetdsouza

@ajeetdsouza , thanks so much for the heads up!

I'm not sure that I'm savvy enough to install Zoxide manually. Roughly how often do new versions get updated in repositories like Anaconda or Linuxbrew?

Edit: Nvm, it was just a matter of cloning the repo and running install.sh. Thanks for making that so easy!

CharlesARoy avatar Sep 06 '22 22:09 CharlesARoy