From cae40b7853231478e319f37db1d11395c3a69919 Mon Sep 17 00:00:00 2001 From: Ade Attwood Date: Tue, 25 Apr 2023 20:16:52 +0100 Subject: [PATCH] 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. --- lua/ivy/utils.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/ivy/utils.lua b/lua/ivy/utils.lua index 41fca29..e54f07b 100644 --- a/lua/ivy/utils.lua +++ b/lua/ivy/utils.lua @@ -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