bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SIGINT handling during async functions


From: Robert Elz
Subject: Re: SIGINT handling during async functions
Date: Fri, 13 Jan 2023 09:02:13 +0700

    Date:        Fri, 13 Jan 2023 00:34:02 +0100
    From:        Tycho Kirchner <tychokirchner@mail.de>
    Message-ID:  <7d59c17d-792e-0ac7-fd86-b3b2e7d4b79a@mail.de>

  | we found quite some inconsistency and weirdness
  | in the handling of SIGINT's during async function calls

Not inconsistent or weird, and has nothing to do with
function calls.

  | and were wondering, whether those are expected.

Expected and required.

  | The main INT handler is never executed in foofunc [...]
  | Thus printing the trap apparently changes bash's behavior.

Nonsense (the conclusion).

When an async command (any command, not just functions,
or blocks enclosed in { } ) is run with job control
disabled, SIGINT is ignored for that async command.
(SIGQUIT too).

That has been the way shells work since before either
the Bourne shell (and all later shells based upon it,
like bash) or job control, were invented.

That is all you are seeing here.

kre



reply via email to

[Prev in Thread] Current Thread [Next in Thread]