Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prefer &shell to git bash on windows even if available #1547

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Konfekt
Copy link

@Konfekt Konfekt commented Jun 4, 2024

calling git bash via cmd on windows is slow and opens a popup window

calling git bash via cmd on windows is slow and opens a popup window
@@ -163,7 +163,7 @@ function! fzf#vim#with_preview(...)
call remove(args, 0)
endif

if !executable(s:bash())
if (has('win32') && &shell !~? '\v<(ba)?sh>') || !executable(s:bash())
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly does this supposed to do?

The original condition checks if a bash is available, and if not, does not add preview options.

So you don't want preview window to appear? Is the title of the PR correct?

Copy link
Author

@Konfekt Konfekt Jun 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Windows, if my shell is not bash, but say cmd as is the default in Win32 Vim, then I prefer not to have a cmd window popping up that calls Git Bash that in turn calls fzf showing something like

C:\WINDOWS\system32\cmd.exe /c (^(C:\PROGRA~1\Git\bin\bash.exe -c ^"ls /mnt/[A-Za-z]^"^) ^>C:\Users\Konfekt\AppData\Local\Temp\VBVAC39.tmp 2^>^&1)

even though Git Bash is installed (which is what executable(s:bash()) checks).
Instead, call fzf directly.

The former is what's currently happening if Git Bash is installed an fzf#vim#with_preview(...) run, say in https://github.com/mg979/vim-mini-plugins/blob/master/plugin/mru.vim

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you show me some screenshots before/after the patch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants