diff --git a/lua/greyjoy/config.lua b/lua/greyjoy/config.lua index 1db02c5..b8ee3a1 100644 --- a/lua/greyjoy/config.lua +++ b/lua/greyjoy/config.lua @@ -29,6 +29,7 @@ local defaults = { show_command_in_output = true, -- Show the command that was running in output patterns = { ".git", ".svn" }, output_result = "buffer", + default_shell = vim.o.shell, -- default shell to run tasks in extensions = {}, last_first = false, -- make sure last option is first on next run, not persistant } diff --git a/lua/greyjoy/init.lua b/lua/greyjoy/init.lua index 8377301..df33588 100644 --- a/lua/greyjoy/init.lua +++ b/lua/greyjoy/init.lua @@ -181,7 +181,10 @@ greyjoy.to_buffer = function(command) vim.api.nvim_buf_set_option(bufnr, "modifiable", false) vim.api.nvim_open_win(bufnr, 1, opts) - vim.fn.jobstart(command.command, { + local commandstr = table.concat(command.command, " ") + local shell_command = { greyjoy.default_shell, "-c", commandstr } + + vim.fn.jobstart(shell_command, { stdout_buffered = true, on_stdout = append_data, on_stderr = append_data,