Skip to content

Commit

Permalink
fix: set shell to sh before executing termopen
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesmithgh committed Nov 22, 2023
1 parent fb9a683 commit c67e52e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lua/kitty-scrollback/kitty_commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ M.get_text_term = function(kitty_data, get_text_opts, on_exit_cb)
local stdout
local stderr
local tail_max = 10

-- set the shell used for termopen to sh to avoid imcompatabiliies with other shells (e.g., nushell, fish, etc)
vim.o.shell = 'sh'

vim.fn.termopen(full_cmd, {
stdout_buffered = true,
stderr_buffered = true,
Expand Down Expand Up @@ -210,6 +214,9 @@ M.get_text_term = function(kitty_data, get_text_opts, on_exit_cb)
end
end,
})

-- restore the original shell after processing termopen
vim.o.shell = p.orig_options.shell
end

M.send_paste_buffer_text_to_kitty_and_quit = function(bracketed_paste_mode)
Expand Down
1 change: 1 addition & 0 deletions lua/kitty-scrollback/launch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ local function set_options()
modifiable = vim.o.modifiable,
wrap = vim.o.wrap,
report = vim.o.report,
shell = vim.o.shell,
}

-- required opts
Expand Down

0 comments on commit c67e52e

Please sign in to comment.