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
    Commented Feb 1, 2021 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. Commented Feb 1, 2021 at 17:02
  • Probably related to this issue though I am already using a newer tmux
    – Rufus
    Commented Feb 11, 2021 at 3:40


You must log in to answer this question.

Browse other questions tagged .