| 1 | |
| 2 | # ISSUE WITH TEST: & means that trap handler isn't run! |
| 3 | # I guess because the background job gets disconnected from the terminal? |
| 4 | # So it doesn't need SIGINT |
| 5 | |
| 6 | # We need some other way to kill it with SIGINT |
| 7 | |
| 8 | kill=$(command -v kill) |
| 9 | |
| 10 | $SH -c 'trap "echo int" INT; sleep 0.2' & |
| 11 | |
| 12 | sleep 0.1 |
| 13 | |
| 14 | $kill -INT $! |
| 15 | |
| 16 | wait |
| 17 | |
| 18 | echo status=$? |