Skip to content

Commit

Permalink
Merge pull request #32 from costowell/development
Browse files Browse the repository at this point in the history
Fix: pass command into shell in buffer mode
  • Loading branch information
desdic authored Jul 15, 2024
2 parents 3d2f0fb + 95462d1 commit 577701d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions lua/greyjoy/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
5 changes: 4 additions & 1 deletion lua/greyjoy/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 577701d

Please sign in to comment.