OILS / spec / testdata / builtin-trap-int.sh View on Github | oilshell.org

16 lines, 5 significant
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$SH -c 'trap "echo int" INT; sleep 0.1' &
9
10sleep 0.05
11
12$(command -v kill) -INT $!
13
14wait
15
16echo status=$?