mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
test: PTY descendants should not prevent exit.
This commit is contained in:
parent
4d4c92535a
commit
ff93c9bd90
@ -466,3 +466,41 @@ describe('jobs', function()
|
|||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
describe("pty process teardown", function()
|
||||||
|
local screen
|
||||||
|
before_each(function()
|
||||||
|
clear()
|
||||||
|
screen = Screen.new(30, 6)
|
||||||
|
screen:attach()
|
||||||
|
screen:expect([[
|
||||||
|
^ |
|
||||||
|
~ |
|
||||||
|
~ |
|
||||||
|
~ |
|
||||||
|
~ |
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
end)
|
||||||
|
after_each(function()
|
||||||
|
screen:detach()
|
||||||
|
end)
|
||||||
|
|
||||||
|
it("does not prevent/delay exit. #4798 #4900", function()
|
||||||
|
-- Use a nested nvim (in :term) to test without --headless.
|
||||||
|
execute(":terminal '"..helpers.nvim_prog
|
||||||
|
-- Use :term again in the _nested_ nvim to get a PTY process.
|
||||||
|
-- Use `sleep` to simulate a long-running child of the PTY.
|
||||||
|
.."' +terminal +'!(sleep 300 &)' +qa")
|
||||||
|
|
||||||
|
-- Exiting should terminate all descendants (PTY, its children, ...).
|
||||||
|
screen:expect([[
|
||||||
|
|
|
||||||
|
[Process exited 0] |
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
-- TERMINAL -- |
|
||||||
|
]])
|
||||||
|
end)
|
||||||
|
end)
|
Loading…
Reference in New Issue
Block a user