fix window cleanup bugs & give prompt its own cleanup func
exit toxic properly on ^C
fix potential race conditions
merge