Skip to content

Commit

Permalink
Fix #3535 - Check for DISPLAY when requesting version information
Browse files Browse the repository at this point in the history
  • Loading branch information
tlercher committed Dec 9, 2018
1 parent b192bf4 commit b479dc1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/display_version.c
Expand Up @@ -55,6 +55,13 @@ static yajl_callbacks version_callbacks = {
*
*/
void display_running_version(void) {
if (getenv("DISPLAY") == NULL) {
fprintf(stderr, "\nYour DISPLAY environment variable is not set.\n");
fprintf(stderr, "Are you running i3 via SSH or on a virtual console?\n");
fprintf(stderr, "Try DISPLAY=:0 i3 --moreversion\n");
exit(EXIT_FAILURE);
}

char *pid_from_atom = root_atom_contents("I3_PID", conn, conn_screen);
if (pid_from_atom == NULL) {
/* If I3_PID is not set, the running version is older than 4.2-200. */
Expand Down

0 comments on commit b479dc1

Please sign in to comment.