We can set this from the return value of `IO.select` on line 363 (new) instead of in the trap handler. I think it's preferable to keep trap handlers as simple as possible.