junegunn / fzf

:cherry_blossom: A command-line fuzzy finder
https://junegunn.github.io/fzf/
MIT License
65.32k stars 2.4k forks source link

[zsh] `CTRL-R` inserting number and binding with FZF_DEFAULT_OPTIONS set #3644

Closed aravance closed 8 months ago

aravance commented 8 months ago

Info

Problem / Steps to reproduce

Case 1

  1. export FZF_DEFAULT_OPTS="--expect=ctrl-y"
  2. <ctrl-r>
  3. select an option with <enter>

expected:

$ echo $FZF_DEFAULT_OPTS

actual:

$ 
 5613  echo $FZF_DEFAULT_OPTS

Case 2

  1. export FZF_DEFAULT_OPTS="--expect=ctrl-y"
  2. <ctrl-r>
  3. select an option with <ctrl-y>

expected:

$ echo $FZF_DEFAULT_OPTS

actual:

$ ctrl-y
 5613  echo $FZF_DEFAULT_OPTS
aravance commented 8 months ago

Likely related: #3591

junegunn commented 8 months ago

You should never put --expect in your FZF_DEFAULT_OPTS. When --expect is given and you press enter or any of the specified keys, fzf will print the name of the key as the first line. This will break every script that doesn't expect an extra line.