fix(startup): make recovery mode work without --headless (#24477)

This commit is contained in:
zeertzjq
2023-07-25 19:02:39 +08:00
committed by GitHub
parent 7668f89d5b
commit c0fa721ade
3 changed files with 25 additions and 13 deletions

View File

@@ -43,7 +43,6 @@ describe('Remote', function()
local function run_remote(...)
set_session(server)
local addr = funcs.serverlist()[1]
local client_argv = { nvim_prog, '--clean', '--headless', '--server', addr, ... }
-- Create an nvim instance just to run the remote-invoking nvim. We want
-- to wait for the remote instance to exit and calling jobwait blocks
@@ -52,7 +51,7 @@ describe('Remote', function()
local client_starter = spawn(new_argv(), false, nil, true)
set_session(client_starter)
-- Call jobstart() and jobwait() in the same RPC request to reduce flakiness.
eq({ 0 }, exec_lua([[return vim.fn.jobwait({ vim.fn.jobstart(..., {
eq({ 0 }, exec_lua([[return vim.fn.jobwait({ vim.fn.jobstart({...}, {
stdout_buffered = true,
stderr_buffered = true,
on_stdout = function(_, data, _)
@@ -61,7 +60,7 @@ describe('Remote', function()
on_stderr = function(_, data, _)
_G.Remote_stderr = table.concat(data, '\n')
end,
}) })]], client_argv))
}) })]], nvim_prog, '--clean', '--headless', '--server', addr, ...))
local res = exec_lua([[return { _G.Remote_stdout, _G.Remote_stderr }]])
client_starter:close()
set_session(server)