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. gitk, 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 DISPLAY variable?

  • Possibly your X server gets restarted when waking from sleep for whatever reason, and then uses the next display slot. Check system logs.
    – dirkt
    Feb 1 at 17:01
  • An X11 display is not the same as a monitor or screen. Yes it uses these words to mean different things. A Display is one or more screens, a keyboard and a pointing device. However what you described sounds vary odd indeed. Feb 1 at 17:02
  • Probably related to this issue though I am already using a newer tmux
    – Rufus
    Feb 11 at 3:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.