fix: more detailed information when ssh connection fails (#27)
This commit is contained in:
parent
31645370a1
commit
f5961e731f
1 changed files with 8 additions and 1 deletions
|
|
@ -101,12 +101,19 @@ function SSHConnection.new(url)
|
||||||
self:_handle_output(new_i_start)
|
self:_handle_output(new_i_start)
|
||||||
end,
|
end,
|
||||||
on_exit = function(j, code)
|
on_exit = function(j, code)
|
||||||
|
pcall(
|
||||||
|
vim.api.nvim_chan_send,
|
||||||
|
self.term_id,
|
||||||
|
string.format("\r\n[Process exited %d]\r\n", code)
|
||||||
|
)
|
||||||
-- Defer to allow the deferred terminal output handling to kick in first
|
-- Defer to allow the deferred terminal output handling to kick in first
|
||||||
vim.defer_fn(function()
|
vim.defer_fn(function()
|
||||||
if code == 0 then
|
if code == 0 then
|
||||||
self:_set_connection_error("SSH connection terminated gracefully")
|
self:_set_connection_error("SSH connection terminated gracefully")
|
||||||
else
|
else
|
||||||
self:_set_connection_error("Unknown SSH error")
|
self:_set_connection_error(
|
||||||
|
'Unknown SSH error\nTo see more, run :lua require("oil.adapters.ssh").open_terminal()'
|
||||||
|
)
|
||||||
end
|
end
|
||||||
end, 20)
|
end, 20)
|
||||||
end,
|
end,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue