diff options
| author | Enno <Konfekt@users.noreply.github.com> | 2024-05-23 02:07:54 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-23 09:07:54 +0900 |
| commit | bfe2bf4dced665f8752dab5f2ce17b67f6ff8b53 (patch) | |
| tree | 94cd8a28ee3d8fe56d562f852c76f58f7de71a1b /plugin | |
| parent | 561f9291fdff168c5103f00ce8e06c554575591d (diff) | |
| download | fzf-bfe2bf4dced665f8752dab5f2ce17b67f6ff8b53.tar.gz | |
[vim] Git Bash Mintty: only use cmd.exe if winpty missing (#3811)
* Git Bash Mintty: only use cmd.exe if winpty missing
Addresses https://github.com/junegunn/fzf/issues/3809
* preferably use term in Git Bash for popup window
See https://github.com/junegunn/fzf/pull/3811#issuecomment-2124241321
Diffstat (limited to 'plugin')
| -rw-r--r-- | plugin/fzf.vim | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim index b724d773..fc36b8c5 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -532,8 +532,9 @@ try \ executable('tput') && filereadable('/dev/tty') let has_vim8_term = has('terminal') && has('patch-8.0.995') let has_nvim_term = has('nvim-0.2.1') || has('nvim') && !s:is_win - let use_term = has_nvim_term || - \ has_vim8_term && !has('win32unix') && (has('gui_running') || s:is_win || s:present(dict, 'down', 'up', 'left', 'right', 'window')) + let use_term = has_nvim_term || has_vim8_term + \ && !(has('win32unix') && $TERM_PROGRAM ==# 'mintty' && !executable('winpty')) + \ && (has('gui_running') || s:is_win || s:present(dict, 'down', 'up', 'left', 'right', 'window')) let use_tmux = (has_key(dict, 'tmux') || (!use_height && !use_term || prefer_tmux) && !has('win32unix') && s:splittable(dict)) && s:tmux_enabled() if prefer_tmux && use_tmux let use_height = 0 @@ -713,10 +714,10 @@ function! s:execute(dict, command, use_height, temps) abort call jobstart(cmd, fzf) return [] endif - elseif has('win32unix') && $TERM !=# 'cygwin' + elseif has('win32unix') && $TERM_PROGRAM ==# 'mintty' && !executable('winpty') 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 command = 'start //WAIT sh -c '.shellscript let a:temps.shellscript = shellscript endif if a:use_height |
