Macbook unexpectedly shuts down programs when I close the lid
Interesting. One setting I would check to see if it's enabled is if it's set to log you out after a certain amount of time. You can do this by going to the system preferences, then security &amp; privacy, then click the advanced button on the lower right corner and the option will be shown.