junegunn / fzf.vim

fzf :heart: vim
MIT License
9.68k stars 585 forks source link

Fzf commands (:Files) open new shell process in Git-bash Windows #1344

Open TheNoble6 opened 3 years ago

TheNoble6 commented 3 years ago

:Files/:FZF in vim within git-bash shell is opening new sh.exe window instead of within vim window.

I tried setting fzf_layout in .vimrc (as in Fzf Vim Readme: let g:fzf_layout = { 'down': '30%' } ) but still getting same behaviour of new shell process in new window, while vim display goes blank

Expected behavior: fzf search window opens within same vim process

Vim Version:

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Sep 21 2021 16:13:20)
Included patches: 1-3441
Compiled by <https://www.msys2.org/>
Huge version without GUI.  Features included (+) or not (-):
+acl               +file_in_path      +mouse_urxvt       -tag_any_white
+arabic            +find_in_path      +mouse_xterm       -tcl
+autocmd           +float             +multi_byte        +termguicolors
+autochdir         +folding           +multi_lang        +terminal
-autoservername    -footer            -mzscheme          +terminfo
-balloon_eval      +fork()            +netbeans_intg     +termresponse
+balloon_eval_term +gettext           +num64             +textobjects
-browse            -hangul_input      +packages          +textprop
++builtin_terms    +iconv             +path_extra        +timers
+byte_offset       +insert_expand     +perl/dyn          +title
+channel           +ipv6              +persistent_undo   -toolbar
+cindent           +job               +popupwin          +user_commands
-clientserver      +jumplist          +postscript        +vartabs
+clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +virtualedit
+cmdline_hist      +langmap           -python            +visual
+cmdline_info      +libcall           +python3/dyn       +visualextra
+comments          +linebreak         +quickfix          +viminfo
+conceal           +lispindent        +reltime           +vreplace
+cryptv            +listcmds          +rightleft         +wildignore
+cscope            +localmap          +ruby/dyn          +wildmenu
+cursorbind        -lua               +scrollbind        +windows
+cursorshape       +menu              +signs             +writebackup
+dialog_con        +mksession         +smartindent       -X11
+diff              +modify_fname      -sodium            -xfontset
+digraphs          +mouse             -sound             -xim
-dnd               -mouseshape        +spell             -xpm
-ebcdic            +mouse_dec         +startuptime       -xsmp
+emacs_tags        -mouse_gpm         +statusline        -xterm_clipboard
+eval              -mouse_jsbterm     -sun_workshop      -xterm_save
+ex_extra          +mouse_netterm     +syntax
+extra_search      +mouse_sgr         +tag_binary
-farsi             -mouse_sysmouse    -tag_old_static
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/etc"
 f-b for $VIMRUNTIME: "/usr/share/vim/vim82"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -I/usr/include/ncursesw -march=x86-64 -mtune=generic -O2 -pipe -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L. -pipe -fstack-protector-strong -pipe -Wl,--as-needed -o vim.exe -lm -lncursesw -liconv -lacl -lintl -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base -fstack-protector-strong -L/usr/lib/perl5/core_perl/CORE -lperl -lpthread -ldl -lcrypt

Minimal config with same issue: (ran with vim -Nu config.txt

set nocompatible hidden laststatus=2

if !filereadable('/tmp/plug.vim')
  silent !curl --insecure -fLo /tmp/plug.vim
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif
source /tmp/plug.vim
call plug#begin('/tmp/plugged')
Plug 'junegunn/fzf', { 'do': './install --bin' }
Plug 'junegunn/fzf.vim'
call plug#end()
let g:fzf_layout = { 'down': '30%' }

autocmd VimEnter * PlugClean! | PlugUpdate --sync
yeurch commented 2 years ago

I'm having the same issue @TheNoble6.

The only workaround I found was to instead run Vim in a Windows Subsystem for Linux (WSL) distribution. However, this isn't great, because there are serious performance problems when accessing directories on your Windows filesystem (present within WSL at /mnt/c/path/to/your/project). It might work ok for a very small project, but with a few tens of thousands of files, each time I run :Files it takes around a minute to index them.

Using neovim instead of vim on Windows produced different results ... instead of the search appearing in a new window, the preview pane of :Files was empty.

Were you able to find a better workaround or fix for this issue?