Test driving on Cygwin is broken
Checklist
- [x] I have read through the manual page (
man fzf) - [x] I have searched through the existing issues
- [x] For bug reports, I have checked if the bug is reproducible in the latest version of fzf
Output of fzf --version
0.62.0 (d226d841)
OS
- [ ] Linux
- [ ] macOS
- [x] Windows
- [ ] Etc.
Shell
- [x] bash
- [ ] zsh
- [ ] fish
Problem / Steps to reproduce
Hello,
I've just downloaded and installed the latest binary as per the Using git subsection of the README:
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install
Sanity-checking of the --help and --version options went fine:
However, "firing it up" with no command-line arguments gave the following message:
C:\cygwin64\tmp\fzf-temp-**3211332915**: line 4: C:\cygwin64\home\mawoo\.vim\bundle\fzf\target\fzf-windows_amd64.msys2_built: command not found
FWIW, the numeric codes in that temp file name change with every rerun.
I am affected by the same issue. For some reason, fzf won't work in a plain zsh shell in mintty, but when I run fzf in a zsh shell in a tmux window, it works just fine.
@clarity20 You're doing something wrong or very weird. Let me explain.
Works fine with Cygwin, and MSYS (in both MSYS and MINGW64 environments.) However, there is no installable package for MSYS, but you can just soft link it to your /usr/bin. (In MINGW64 the package will install to /mingw64/bin/.
For Cygwin, you need to make sure it's available in your PATH. You can't just use a temp and expect it to work, as it uses sub-processes which will never get your locally defined variables.
[!IMPORTANT] If you have other windows versions of Fzf in your Windows path, they have to be removed before you can use the Cygwin ones.
Put your binaries in your (Cygwin) PATH, or in your Cugwin $HOME directory, under /home/USER/.fzf/bin.
Then use this in your .bashrc:
# Setup fzf:
if [[ ! "$PATH" == */home/USER/.fzf/bin* ]]; then
PATH="${PATH:+${PATH}:}/home/USER/.fzf/bin"
fi
# The AMD64 binary is incompatible with Cygwin unless you set the following:
# See: https://github.com/junegunn/fzf/issues/4106
export MSYS=enable_pcon
# NOTE:
# We might need to move this to the very end of this file, to avoid breaking/masking interference.
# Set up FZF key bindings and fuzzy completion:
eval "$(fzf --bash)"
export FZF_DEFAULT_OPTS="--ansi --tabstop=4"
:arrow_up: NOTE: #4106