>>>>> "D" == David King Landrith <dave / landrith.com> writes:

D> This is exactly the type of elegant solution that I'm looking for.  
D> Unfortunately, this behaves exactly the same as trap 0, proc { endwin 
D> }.  (What is the difference between at_exit and trap 0?)

 You can have different at_exit

pigeon% ruby -e 'at_exit { p 1 }; at_exit { p 2 }'
2
1
pigeon% 


Guy Decoux