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

zsh: Extra space gets inserted when aborting <Space>+<Tab> fzf window #913

Open
ferdinandrau opened this issue Oct 7, 2024 · 0 comments

Comments

@ferdinandrau
Copy link

ferdinandrau commented Oct 7, 2024

Hi, thanks for making this great tool.

When using it under Zsh I've encountered a small annoyance: When closing the fzf completion menu opened with tab, a space character gets inserted after however many trailing spaces there already where. So when you open and close the menu a bunch of times, each time a space gets added and you end up with that number of trailing spaces (+1, obviously). This does not happen when doing <Space>+<Ctrl-D>, which i have mapped to the list-choices ZLE widget (standard mapping in the vi insert mode of Zsh).

I can reproduce this with a minimal .zshrc on Zsh 5.9 (macOS, left out some irrelevant parts):

zstyle ':completion:*' menu select
zstyle ':completion:*' completer _extensions _complete _approximate
zstyle ':completion:*' matcher-list '' m:{a-zA-Z}={A-Za-z} 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*' squeeze-slashes true
zstyle ':completion:*' complete-options true
zstyle ':completion:*' use-cache true
zstyle ':completion:*' cache-path "$ZSH_CACHE_DIR/compcache-$ZSH_VERSION"

autoload -Uz compinit && compinit -d "$ZSH_CACHE_DIR/compdump-$ZSH_VERSION"

eval "$(zoxide init zsh --cmd cd)"

I would say this behavior is not really desirable and probably a bug because exiting the menu should not alter what has been typed at all.

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

1 participant