fix: never let a shell command fail

This makes the terminal go really funkie and sometimes crash when
printing the error messages to the current process stdout where nvim is
running.

Now the error output is sent to the `popen` output and displayed in the
ivy completion buffer without messing with the current process io.
This commit is contained in:
Ade Attwood 2023-04-25 20:16:52 +01:00
parent ff7c28490d
commit 10a3117aae

View file

@ -33,7 +33,7 @@ utils.command_finder = function(command, min)
-- TODO(ade): Think if we want to start escaping the command here. I
-- dont know if its causing issues while trying to use regex especially
-- with word boundaries `input:gsub("'", "\\'"):gsub('"', '\\"')`
local handle = io.popen(command .. " " .. input .. " 2>&1")
local handle = io.popen(command .. " " .. input .. " 2>&1 || true")
if handle == nil then
return {}
end