From 7fdb45e0f8b2dfc367067c62e413dd8082d770d5 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 26 Nov 2018 22:14:18 +0100 Subject: preserve_exit: Ignore SIGHUP closes #9274 ref #9028 If stdin closed then read_error_exit calls preserve_exit. Handling SIGHUP during preserve_exit would cause a premature teardown, and conflicts with e.g. ui_bridge_stop which waits for TUI to teardown. Vim ignores SIGHUP in its prepare_to_exit and getout_preserve_modified routines: /* Ignore SIGHUP, because a dropped connection causes a read error, which * makes Vim exit and then handling SIGHUP causes various reentrance * problems. */ signal(SIGHUP, SIG_IGN); --- test/functional/autocmd/termclose_spec.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test') diff --git a/test/functional/autocmd/termclose_spec.lua b/test/functional/autocmd/termclose_spec.lua index db4e5379d0..62eac59b16 100644 --- a/test/functional/autocmd/termclose_spec.lua +++ b/test/functional/autocmd/termclose_spec.lua @@ -6,6 +6,7 @@ local clear, command, nvim, nvim_dir = local eval, eq, retry = helpers.eval, helpers.eq, helpers.retry local ok = helpers.ok +local feed = helpers.feed local iswin = helpers.iswin @@ -87,5 +88,6 @@ describe('TermClose event', function() command('3bdelete!') retry(nil, nil, function() eq('3', eval('g:abuf')) end) + feed(':qa!') end) end) -- cgit