mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 20:55:18 -07:00
feat(remote): avoid --remote-ui infinite loop (#24465)
This commit is contained in:
parent
e551d623d2
commit
7b0123dd6a
@ -921,6 +921,11 @@ static void remote_request(mparm_T *params, int remote_args, char *server_addr,
|
|||||||
os_errmsg(connect_error);
|
os_errmsg(connect_error);
|
||||||
os_errmsg("\n");
|
os_errmsg("\n");
|
||||||
os_exit(1);
|
os_exit(1);
|
||||||
|
} else if (strequal(server_addr, os_getenv("NVIM"))) {
|
||||||
|
os_errmsg("Cannot attach UI of :terminal child to its parent. ");
|
||||||
|
os_errmsg("(Unset $NVIM to skip this check)");
|
||||||
|
os_errmsg("\n");
|
||||||
|
os_exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
ui_client_channel_id = chan;
|
ui_client_channel_id = chan;
|
||||||
|
@ -41,6 +41,19 @@ describe('startup', function()
|
|||||||
ok(string.find(alter_slashes(meths.get_option_value('runtimepath', {})), funcs.stdpath('config'), 1, true) == nil)
|
ok(string.find(alter_slashes(meths.get_option_value('runtimepath', {})), funcs.stdpath('config'), 1, true) == nil)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('prevents remote UI infinite loop', function()
|
||||||
|
clear()
|
||||||
|
local screen
|
||||||
|
screen = Screen.new(84, 3)
|
||||||
|
screen:attach()
|
||||||
|
funcs.termopen({ nvim_prog, '-u', 'NONE', '--server', eval('v:servername'), '--remote-ui' })
|
||||||
|
screen:expect([[
|
||||||
|
^Cannot attach UI of :terminal child to its parent. (Unset $NVIM to skip this check) |
|
||||||
|
|
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
end)
|
||||||
|
|
||||||
it('--startuptime', function()
|
it('--startuptime', function()
|
||||||
local testfile = 'Xtest_startuptime'
|
local testfile = 'Xtest_startuptime'
|
||||||
finally(function()
|
finally(function()
|
||||||
|
Loading…
Reference in New Issue
Block a user