First attempt to auto closing compilation window working for different use cases.