junegunn / junegunn/fzf

Vim plugin doesn't work at all on Cygwin; removing special-casing in fzf.vim may fix it

Open
#2,153 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
83k
Forks
2.9k
Avg merge
17h 8m
Merged PRs (30d)
10

Description

- [X] I have read through the manual page (`man fzf`)
- [X] I have the latest version of fzf
- [X] I have searched through the existing issues

## Info

- OS
- [ ] Linux
- [ ] Mac OS X
- [X] Windows
- [ ] Etc.
- Shell
- [ ] bash
- [ ] zsh
- [ ] fish

## Problem / Steps to reproduce

I am running Vim with the fzf and fzf.vim plugins under Cygwin. Whenever I try to use one of the fzf.vim commands, such as `:Files` or `:Rg`, the following happens:

1. The terminal goes blank
2. A separate console window opens and closes again immediately. (No output seems to appear in it.)
3. The terminal un-blanks again, and I'm back where I started (e.g. editing a file).

All of this happens in about a second.

I've found that by commenting out the following `elseif` block [at line 590 of `plugin/fzf.vim`](https://github.com/junegunn/fzf/blob/c0a83b27eb0e2a9a1f631d04830a7dc6d762a951/plugin/fzf.vim#L590) in its entirety, I can restore what seems to be the correct behaviour, namely that the fzf file selection pane is shown:
```vim
elseif has('win32unix') && $TERM !=# 'cygwin'
let shellscript = s:fzf_tempname()
call writefile([command], shellscript)
let command = 'cmd.exe /C '.fzf#shellescape('set "TERM=" & start /WAIT sh -c '.shellscript)
let a:temps.shellscript = shellscript
```
It seems to be treating Cygwin differently from other Windows-UNIX environments, and I'm wondering whether that's still the right thing to do. Cygwin now uses mintty as its default terminal, and that has `TERM=xterm` by default. In fact, `TERM=cygwin` doesn't even seem to be an option in mintty.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.