Skip to content

Commit

Permalink
fix(windows): fully qualify "cmd.exe" (closes #1396)
Browse files Browse the repository at this point in the history
MSYS2 comes with "/usr/bin/cmd", to avoid conflicts we
specifically use "cmd.exe".
  • Loading branch information
ibhagwan committed Aug 12, 2024
1 parent 64a305a commit f036a79
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lua/fzf-lua/fzf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ function M.raw_fzf(contents, fzf_cli_args, opts)
local co = coroutine.running()
local jobstart = opts.is_fzf_tmux and vim.fn.jobstart or vim.fn.termopen
local shell_cmd = utils.__IS_WINDOWS
and { "cmd", "/d", "/e:off", "/f:off", "/v:off", "/c" }
-- MSYS2 comes with "/usr/bin/cmd" that precedes "cmd.exe" (#1396)
and { "cmd.exe", "/d", "/e:off", "/f:off", "/v:off", "/c" }
or { "sh", "-c" }
if utils.__IS_WINDOWS then
utils.tbl_join(shell_cmd, cmd)
Expand Down
2 changes: 1 addition & 1 deletion lua/fzf-lua/libuv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ M.spawn = function(opts, fn_transform, fn_done)

-- https://github.com/luvit/luv/blob/master/docs.md
-- uv.spawn returns tuple: handle, pid
local shell = _is_win and "cmd" or "sh"
local shell = _is_win and "cmd.exe" or "sh"
local args = _is_win and { "/d", "/e:off", "/f:off", "/v:on", "/c" } or { "-c" }
if type(opts.cmd) == "table" then
if _is_win then
Expand Down

0 comments on commit f036a79

Please sign in to comment.