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

[BUG] Git completion gets deleted #63

gbrlsnchs opened this issue Mar 19, 2020 · 2 comments

[BUG] Git completion gets deleted #63

gbrlsnchs opened this issue Mar 19, 2020 · 2 comments


Copy link

@gbrlsnchs gbrlsnchs commented Mar 19, 2020

Describe the bug
When I type the first path segment of a directory as an argument for a Git command, the path gets deleted from prompt.

To Reproduce
Steps to reproduce the behavior:

  1. Create a testing directory
  2. cd into that directory and initialize a Git repo with git init
  3. mkdir foo
  4. touch foo/bar
  5. Type git add foo
  6. Press Tab
  7. See error: foo gets deleted and the cursor goes back one step

This always happens when you type the exact name of the directory. If you type only part of it, you get the right completion. If you put the final slash after foo, it also works as expected.

Expected behavior
It should complete with a slash in order to allow subsequent completions.

I made an asciicast of the problem:

Environment (please complete the following information):

  • OS: Void Linux
  • zsh version: zsh 5.8 (x86_64-unknown-linux-gnu)
  • fzf-tab version: f0627fe


prompt_cmd() {


source /usr/share/google-cloud-sdk/
source $XDG_DATA_HOME/antigen/antigen.zsh

antigen use oh-my-zsh
antigen bundle git
antigen bundle vi-mode
antigen bundle command-not-found
antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle zsh-users/zsh-completions
antigen bundle Aloxaf/fzf-tab
antigen theme lambda
antigen apply

source /usr/share/doc/fzf/completion.zsh
source /usr/share/doc/fzf/key-bindings.zsh

_gen_fzf_default_opts() {
    local gruvbox_bg0='#282828'
    local gruvbox_bg1='#3c3836'
    local gruvbox_bg3='#665c54'
    local gruvbox_red='#cc241d'
    local gruvbox_green='#98971a'
    local gruvbox_yellow='#d79921'
    local gruvbox_blue='#458588'
    local gruvbox_purple='#b16286'
    local gruvbox_aqua='#689d6a'
    local gruvbox_gray='#a89984'
    local gruvbox_gray_alt='#928374'
    local gruvbox_red_alt='#fb4934'
    local gruvbox_green_alt='#b8bb26'
    local gruvbox_yellow_alt='#fabd2f'
    local gruvbox_blue_alt='#83a598'
    local gruvbox_purple_alt='#d3869b'
    local gruvbox_aqua_alt='#8ec07c'
    local gruvbox_orange='#d65d0e'
    local gruvbox_fg1='#ebdbb2'
    local gruvbox_fg4='#a89984'

    export FZF_DEFAULT_OPTS="

    export FZF_DEFAULT_COMMAND="rg --files --hidden --follow --glob '!.git'"

@gbrlsnchs gbrlsnchs added the bug label Mar 19, 2020
Aloxaf added a commit that referenced this issue Mar 20, 2020
see #63
`git init; mkdir -p foo/bar; git add foo\t` will add an empty match
with `/` as hidden prefix to just add a slash.

This comment has been minimized.

Copy link

@Aloxaf Aloxaf commented Mar 20, 2020

Thanks for your report!
Fixed. Please update fzf-tab and try again.


This comment has been minimized.

Copy link

@gbrlsnchs gbrlsnchs commented Mar 20, 2020

That was fast, thank you very much, it's working now! ❤️

@gbrlsnchs gbrlsnchs closed this Mar 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.