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] zsh bad pattern when enabling recommended preview command #321

Open
5 tasks done
de846 opened this issue Oct 31, 2022 · 5 comments
Open
5 tasks done

[BUG] zsh bad pattern when enabling recommended preview command #321

de846 opened this issue Oct 31, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@de846
Copy link

de846 commented Oct 31, 2022

Describe the bug

Configuring the provided example zstyle option for previewing with cd command results in zsh bad pattern error message.

I can make sure:

  • I am using the latest version of fzf-tab
  • this is the minimal zshrc which can reproduce this bug
  • fzf-tab is loaded after compinit
  • fzf-tab is loaded after plugins which will wrap Tab, like junegunn/fzf/completion.zsh
  • fzf-tab is loaded before zsh-autosuggestions, zsh-syntax-highlighting and fast-syntax-highlighting.

To Reproduce

Steps to reproduce the behavior:
First-time setup:

  1. Source the fzf-tab-plugin
  2. Set the following zstyle line zstyle ':fzf-tab:complete:cd:*' fzf-preview 'exa -1 --color=always $realpath'

Then, In a new zsh

  1. Type 'cd'
  2. Press Tab
  3. See error:
zsh:3: bad pattern: _ftb_compcap=(Desktop^B<^@>^@group^@1^@realdir^@^@args^@-Q^A-s^A^A-W^A^A-M^Ar:|/=* r:|=*^A-p^A^A-f^@word^@Desktop

Expected behavior

I expect the preview window to display the output of the command set by the zstyle command.

Screenshots

image

Environment:

  • OS: [RHEL 7]
  • zsh version: [5.9]

Minimal zshrc

source ~/.oh-my-zsh/custom/plugins/fzf-tab/fzf-tab.plugin.zsh
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'exa -1 --color=always $realpath'
HISTSIZE=500000
SAVEHIST=500000

Log

If applicable, use C-x . to trigger completion and provide the log.

tags in context :completion::complete:cd::
    local-directories  (_cd)

If there are only three lines in your log, please make sure your fzf-tab is loaded with the correct order (see the checklist above).

@de846 de846 added the bug Something isn't working label Oct 31, 2022
@ayroblu
Copy link

ayroblu commented Nov 17, 2022

I assume the issue is in this variable declaration:

local -a _ftb_compcap=(\"\${(@f)mapfile[$tmp_dir/compcap.$$]}\")

@Aloxaf
Copy link
Owner

Aloxaf commented Nov 24, 2022

How did you install zsh? Compile from source or install from RHEL official repo?

Can you provide the output of fzf --version && zsh --version ?

@ayroblu
Copy link

ayroblu commented Nov 25, 2022

For me personally I'm using a standalone zsh + 0.30.0 fzf, but I'm wondering if it's possible to use a standard fzf completion here? Like I was really just trying to have tab trigger fzf in the same way that ctrl-t does, and there's a bunch of extra stuff happening.

@de846
Copy link
Author

de846 commented Nov 28, 2022

How did you install zsh? Compile from source or install from RHEL official repo?

Can you provide the output of fzf --version && zsh --version ?

❯ fzf --version
0.33.0 (0.33.0)

❯ zsh --version
zsh 5.9 (x86_64-pc-linux-gnu)

I'm using Nix packaged versions of fzf and zsh from Nixpkgs.

@ayroblu
Copy link

ayroblu commented Dec 29, 2022

Figured this out for my use case, because I was using this on a corp, I had copied my macOS plugin to the centos box. By remaking in docker, and copying the output of that, this resolved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants