diff --git a/src/fish_tests.cpp b/src/fish_tests.cpp index 904bc93bd..be17c407f 100644 --- a/src/fish_tests.cpp +++ b/src/fish_tests.cpp @@ -1065,18 +1065,6 @@ static void test_cancellation() { test_1_cancellation(L"while true ; echo nothing > /dev/null; end"); test_1_cancellation(L"for i in (while true ; end) ; end"); - // Ensure that if child processes SIGINT, we exit our loops - // Test for #3780 - // Ugly hack - temporarily fake an interactive session - // else we will SIGINT ourselves in response to our child death - session_interactivity_t iis = session_interactivity(); - set_interactive_session(session_interactivity_t::implied); - const wchar_t *child_self_destructor = L"while true ; sh -c 'sleep .25; kill -s INT $$' ; end"; - parser_t::principal_parser().eval(child_self_destructor, io_chain_t()); - set_interactive_session(iis); - - // Restore signal handling. - interactive.restore(); signal_reset_handlers(); // Ensure that we don't think we should cancel. diff --git a/tests/checks/sigint2.fish b/tests/checks/sigint2.fish new file mode 100644 index 000000000..a8b1d18e8 --- /dev/null +++ b/tests/checks/sigint2.fish @@ -0,0 +1,14 @@ +#RUN: %fish -C "set helper %fish_test_helper" %s + +# Ensure that if child processes SIGINT, we exit our loops +# Test for #3780 + +echo About to sigint +#CHECK: About to sigint + +while true + sh -c 'echo Here we go; sleep .25; kill -s INT $$' +end +#CHECK: Here we go + +echo I should not be printed because of the SIGINT.