diff --git a/lua/kitty-scrollback/kitty_commands.lua b/lua/kitty-scrollback/kitty_commands.lua index f9245b39..46f870ff 100644 --- a/lua/kitty-scrollback/kitty_commands.lua +++ b/lua/kitty-scrollback/kitty_commands.lua @@ -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, @@ -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) diff --git a/lua/kitty-scrollback/launch.lua b/lua/kitty-scrollback/launch.lua index a9eb29b8..ffc27c60 100644 --- a/lua/kitty-scrollback/launch.lua +++ b/lua/kitty-scrollback/launch.lua @@ -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