Skip to content

Commit 4462770

Browse files
committed
posix-session: check for Wayland display envars
Also check for the WAYLAND_DISPLAY environment variable when determining if a graphical session/display exists for POSIX systems.
1 parent a130fec commit 4462770

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/shared/Core/CommandContext.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ public CommandContext()
134134
else if (PlatformUtils.IsLinux())
135135
{
136136
FileSystem = new LinuxFileSystem();
137-
// TODO: support more than just 'Posix' or X11
138137
SessionManager = new PosixSessionManager();
139138
Environment = new PosixEnvironment(FileSystem);
140139
ProcessManager = new ProcessManager(Trace2);

src/shared/Core/Interop/Posix/PosixSessionManager.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ public PosixSessionManager()
99
PlatformUtils.EnsurePosix();
1010
}
1111

12-
// Check if we have an X11 environment available
13-
public virtual bool IsDesktopSession => !string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("DISPLAY"));
12+
// Check if we have an X11 or Wayland display environment available
13+
public virtual bool IsDesktopSession =>
14+
!string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("DISPLAY")) ||
15+
!string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("WAYLAND_DISPLAY"));
1416
}
1517
}

0 commit comments

Comments
 (0)