junegunn / fzf

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

FZF_DEFAULT_OPTS is broken on OSX, installing via brew or git clone #3880

Closed timjrobinson closed 2 weeks ago

timjrobinson commented 2 weeks ago

Checklist

Output of fzf --version

$FZF_DEFAULT_OPTS: unknown option: -

OS

Shell

Problem / Steps to reproduce

Installing the latest version of fzf via either Brew or Git fails. Something is setting up a default options string that fzf can't parse and so it can't run and cmd+r shows this same error message.

tim@Tims-MBP ~ % git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install
Cloning into '/Users/tim/.fzf'...
remote: Enumerating objects: 131, done.
remote: Counting objects: 100% (131/131), done.
remote: Compressing objects: 100% (123/123), done.
remote: Total 131 (delta 4), reused 49 (delta 2), pack-reused 0
Receiving objects: 100% (131/131), 301.74 KiB | 2.74 MiB/s, done.
Resolving deltas: 100% (4/4), done.
Downloading bin/fzf ...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 1501k  100 1501k    0     0   804k      0  0:00:01  0:00:01 --:--:-- 4735k
Archive:  /var/folders/66/vx9npt091fd6yjgnbrxlgn7m0000gn/T//fzf.zip
  inflating: fzf
  inflating: ._fzf
  - Checking fzf executable ... Error: $FZF_DEFAULT_OPTS: unknown option: -
  - Invalid binary !!!
go executable not found. Installation failed.

tim@Tims-MBP ~ % echo $FZF_DEFAULT_OPTS
 - height=40% - preview="bat - color=always {}" - preview-window=right:60%:wrap
tim@Tims-MBP ~ % export FZF_DEFAULT_OPTS=
tim@Tims-MBP ~ % echo $FZF_DEFAULT_OPTS

tim@Tims-MBP ~ % git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install
fatal: destination path '/Users/tim/.fzf' already exists and is not an empty directory.
Downloading bin/fzf ...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 1501k  100 1501k    0     0  1227k      0  0:00:01  0:00:01 --:--:-- 10.1M
Archive:  /var/folders/66/vx9npt091fd6yjgnbrxlgn7m0000gn/T//fzf.zip
  inflating: fzf
  inflating: ._fzf
  - Checking fzf executable ... 0.53.0
Do you want to enable fuzzy auto-completion? ([y]/n) y
Do you want to enable key bindings? ([y]/n) y

Generate /Users/tim/.fzf.bash ... OK
Generate /Users/tim/.fzf.zsh ... OK

Do you want to update your shell configuration files? ([y]/n) y

Update /Users/tim/.bashrc:
  - [ -f ~/.fzf.bash ] && source ~/.fzf.bash
    + Added

Update /Users/tim/.zshrc:
  - [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
    - Already exists: line #1

Finished. Restart your shell or reload config file.
   source ~/.bashrc  # bash  (.bashrc should be loaded from .bash_profile)
   source ~/.zshrc   # zsh

Use uninstall script to remove fzf.

For more information, see: https://github.com/junegunn/fzf
tim@Tims-MBP ~ % source ~/.zshrc
tim@Tims-MBP ~ % $FZF_DEFAULT_OPTS: unknown option: -
tim@Tims-MBP ~ % echo $FZF_DEFAULT_OPTS
 - height=40% - preview="bat - color=always {}" - preview-window=right:60%:wrap
tim@Tims-MBP ~ % fzf
$FZF_DEFAULT_OPTS: unknown option: -
tim@Tims-MBP ~ % fzf --version
$FZF_DEFAULT_OPTS: unknown option: -
timjrobinson commented 2 weeks ago

Nevermind I found there was a default options line export FZF_DEFAULT_OPTS=' - height=40% - preview="bat - color=always {}" - preview-window=right:60%:wrap' in my~/.zshrc` that was setting this. I don't know where it came from though.