in reply to Re: Child process lingers after keyboard interrupt on Windows
in thread Child process lingers after keyboard interrupt on Windows

How do you forward the interupt?can you show some code?
  • Comment on Re^2: Child process lingers after keyboard interrupt on Windows

Replies are listed 'Best First'.
Re^3: Child process lingers after keyboard interrupt on Windows
by LanX (Saint) on Oct 21, 2018 at 08:17 UTC
Re^3: Child process lingers after keyboard interrupt on Windows
by toughy (Acolyte) on Oct 23, 2018 at 19:38 UTC

    The included code:

    $SIG{'INT'} = sub { kill 'INT', $pid if $pid };

    would be the Perl way to forward an interrupt. Except:

    • the INT signal is normally sent to all processes in the group anyway, so you only forward it like this if you know the child went to some other process group already. And then, it probably went away to avoid this kind of interrupt.
    • In a similar way, Windows also sends ^C (Ctrl+C) to all processes attached to that console
    • signals do not really exist on Windows, and there this call to kill directly kills the process, no signal sent whatsoever

    Or at least this is what the documentation says. Because when I try it out, nothing works as it should since I got on Windows...