I've never connected my laptop to an external monitor so I am always using the laptop's primary display. Occasionally, when waking from sleep, I realize that some of the GUI apps (e.g.
git gui) stop working and give the error
application-specific initialization failed: couldn't connect to display ":0"
Every time, this is fixed by
export DISPLAY=:1. Why does this happen? What is happening under the hood that requires me to manually change my