Skip to content

Commit

Permalink
fix: interface hangs with fish shell stdin redirect (closes #633)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibhagwan committed Feb 11, 2023
1 parent 3a02336 commit a294a83
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lua/fzf-lua/fzf.lua
Expand Up @@ -58,7 +58,15 @@ function M.raw_fzf(contents, fzf_cli_args, opts)
end
FZF_DEFAULT_COMMAND = contents
else
cmd = ("%s < %s"):format(cmd, vim.fn.shellescape(fifotmpname))
-- Note: for some unknown reason, even though 'termopen' cmd is wrapped with
-- `sh -c`, on rare occasions (or unique systems?) when using `fish` shell,
-- commands that use the input redirection will hang indefintely (#633)
-- Using `cat` instead to read from the FIFO named pipe seems to solve it,
-- this is also better as it lets fzf handle spawning and terminating the
-- command which is consistent with the behavior above (with string cmds)
FZF_DEFAULT_COMMAND = string.format("cat %s", vim.fn.shellescape(fifotmpname))
-- Previously used command, left commented for documentation reasons
-- cmd = ("%s < %s"):format(cmd, vim.fn.shellescape(fifotmpname))
end
end

Expand Down

0 comments on commit a294a83

Please sign in to comment.