Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 1 addition & 23 deletions lua/kitty-scrollback/kitty_commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,29 +63,7 @@ local function defer_resize_term(min_cols)
return orig_columns
end

local open_term_command_from_nvim_version = function()
if vim.fn.has('nvim-0.11') == 1 then
-- intentionally pass an invalid argument type to term
-- if an error is returned that it must be boolean then term exists for jobstart
---@type boolean, integer|string
local ok, err = pcall(vim.fn.jobstart, '', { term = 1 })
local jobstart_has_term = not ok
and err:match([[Vim:E475: Invalid argument: 'term' must be Boolean]])
and true
or false
if jobstart_has_term then
return 'jobstart'
else
-- using Neovim v0.11, however, it is on a commit before implementing term on jobstart
return 'termopen'
end
else
-- earlier versions of Neovim use termopen
return 'termopen'
end
end

M.open_term_command = open_term_command_from_nvim_version()
M.open_term_command = vim.fn.has('nvim-0.11') <= 0 and 'termopen' or 'jobstart'

---@param get_text_opts KsbKittyGetTextArguments
---@param on_exit_cb function
Expand Down