From dccf2e0c978aa697f920c9a60205a45c17b662ee Mon Sep 17 00:00:00 2001 From: Cole Stowell Date: Sun, 14 Jul 2024 16:04:16 -0500 Subject: [PATCH 1/2] Fix: pass command into shell in buffer mode --- lua/greyjoy/config.lua | 1 + lua/greyjoy/init.lua | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) 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..f8015af 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 = { config['default_shell'], "-c", commandstr } + + vim.fn.jobstart(shell_command, { stdout_buffered = true, on_stdout = append_data, on_stderr = append_data, From 95462d18440254046652416b5b584b740997c3e3 Mon Sep 17 00:00:00 2001 From: Kim Nielsen Date: Mon, 15 Jul 2024 12:50:56 +0200 Subject: [PATCH 2/2] Update init.lua use correct config --- lua/greyjoy/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/greyjoy/init.lua b/lua/greyjoy/init.lua index f8015af..df33588 100644 --- a/lua/greyjoy/init.lua +++ b/lua/greyjoy/init.lua @@ -182,7 +182,7 @@ greyjoy.to_buffer = function(command) vim.api.nvim_open_win(bufnr, 1, opts) local commandstr = table.concat(command.command, " ") - local shell_command = { config['default_shell'], "-c", commandstr } + local shell_command = { greyjoy.default_shell, "-c", commandstr } vim.fn.jobstart(shell_command, { stdout_buffered = true,