Skip to content
New issue

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

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

Already on GitHub? # to your account

make :FZF work in Vim from Git Bash #3798

Merged
merged 2 commits into from
May 15, 2024
Merged

Conversation

Konfekt
Copy link
Contributor

@Konfekt Konfekt commented May 15, 2024

Despite its title 'Calling fzf#run with a list as source fail (n)vim is used from git bash' the issue in

#3777

of running :FZF in Vim in Git Bash was apparently only fixed for Neovim in Git Bash on Windows 11, but not for Vim from Git Bash.

In view of this, replacing /C by ///C might be considered a universal fix.

This PR just proposes the patch in #1983 that still seems open.

In view of the fourth item in the most recent 2.45.0 https://github.com/git-for-windows/build-extra/blob/main/ReleaseNotes.md#known-issues little seems to have changed regarding path conversion of arguments containing forward slashes

Konfekt added 2 commits May 15, 2024 07:22
Despite its title 'Calling fzf#run with a list as source fail (n)vim is used from git bash' the issue in 

junegunn#3777

of running `:FZF` in Vim in Git Bash was apparently only fixed for Neovim in Git Bash on Windows 11, but not for Vim from Git Bash.

In view of this, replacing /C by ///C might be considered a universal fix.

This PR just proposes the patch in junegunn#1983 that still seems open.

In view of the fourth item in the most recent 2.45.0 https://github.com/git-for-windows/build-extra/blob/main/ReleaseNotes.md#known-issues little seems to have changed regarding path conversion of arguments containing forward slashes
If MSYS_NO_PATHCONV=1 is used, then all arguments are preserved, in particular possibly paths passed in s:command.
Therefore, only avoid converting `/C` from `cmd` to a path.
Copy link
Owner

@junegunn junegunn left a comment

Choose a reason for hiding this comment

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

I just tested it on a Windows Server 2022 EC2 instance on AWS. Without the patch, cmd.exe opens when I run any command from fzf.vim, but with the patch, fzf opens in a cmd window.

Though I don't fully understand what's going on under the hood, it apparently fixes the problem, so I'm going to merge this.

Thanks a lot.

@junegunn junegunn merged commit 0994d9c into junegunn:master May 15, 2024
5 checks passed
@junegunn junegunn mentioned this pull request May 15, 2024
10 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants