summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--.vim/lua/job.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/.vim/lua/job.lua b/.vim/lua/job.lua
index 7261d24..b6c34f7 100644
--- a/.vim/lua/job.lua
+++ b/.vim/lua/job.lua
@@ -26,10 +26,17 @@ function M.jobstart(opts, _wrap_command_for_presentation)
     if not lines or #lines < 1 then
       lines = j:stderr_result()
     end
+
+    -- strip ansi terminal color codes
+    for i = 1, #lines do
+      lines[i] = (lines[i]):gsub(string.char(27) .. '[[0-9;]*m', '')
+    end
+
     vim.fn.setqflist({}, ' ', {
       title = title,
       lines = lines,
     })
+
     if #lines > 0 then
       vim.api.nvim_command('doautocmd QuickFixCmdPost')
     end