Open jasom opened 2 months ago
Oh weird, never heard that rule ...
This may need some more work in https://github.com/oils-for-unix/oils/blob/master/frontend/signal_gen.py
This should only require work in https://github.com/oils-for-unix/oils/blob/master/builtin/trap_osh.py to call RemoveUser{Trap|Hook} when the first argument is an unsigned integer, no?
Oh maybe ... the spec tests can answer that. The text is hard for me to parse
Are you interested in adding some tests and maybe implementing it? If it is only clearing traps it should be straightforward
$ test/spec.sh builtin-trap
builtin-trap.test.sh
case line dash bash mksh ash osh
0 6 pass pass pass pass pass trap accepts/ignores --
1 14 pass pass pass pass ok trap 'echo hi' KILL (regression test, caught by smoosh suite)
2 40 pass pass pass pass pass Register invalid trap
3 44 pass pass pass pass pass Remove invalid trap
in spec/builtin-trap.test.sh
From the POSIX spec:
I really don't want to know what buggy ill-specified behavior in an old Unix shell caused it to be standardized this way, but other shells appear to implement this: