Skip to content

On fzf.vim opening in new cmd Window in Git Bash #3809

@ykhan21

Description

@ykhan21

Checklist

  • I have read through the manual page (man fzf)
  • I have searched through the existing issues
  • For bug reports, I have checked if the bug is reproducible in the latest version of fzf

Output of fzf --version

0.52.1 (6432f00)

OS

  • Linux
  • macOS
  • Windows
  • Etc.

Shell

  • bash
  • zsh
  • fish

Problem / Steps to reproduce

This PR made by @Konfekt allows fzf.vim to work in Git Bash.
However, I found that by commenting the following part of the if-branch allows fzf.vim with the stock vim in Git Bash to run normally.

fzf/plugin/fzf.vim

Lines 711 to 716 in daa6024

elseif has('win32unix') && $TERM !=# 'cygwin'
let shellscript = s:fzf_tempname()
call s:writefile([command], shellscript)
let command = 'cmd.exe //C '.fzf#shellescape('set "TERM=" & start /WAIT sh -c '.shellscript)
let a:temps.shellscript = shellscript
endif

In Git Bash's vim, :echo has('unix') returns 1, :echo has('win32unix') returns 1, :echo has('win32') returns 0, and :echo has('win64') returns 0.

What is has('win32unix') used for? It seems like it can be removed in a few cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions