MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / guiAvailable

Function guiAvailable

e2e/desktop-packaged/supervised-attach.test.ts:33–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31// only where a display is reachable (a logged-in console, or a guest under
32// autologin/Xvfb) and skips honestly elsewhere rather than hanging on launch.
33const guiAvailable = (): boolean => {
34 if (process.platform === "darwin") {
35 // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: probing the session manager; absence = no GUI
36 try {
37 return execFileSync("launchctl", ["managername"], { encoding: "utf8" }).trim() === "Aqua";
38 } catch {
39 return false;
40 }
41 }
42 if (process.platform === "linux") {
43 return Boolean(process.env.DISPLAY || process.env.WAYLAND_DISPLAY);
44 }
45 return true; // windows: the runner places this in an interactive session
46};
47
48const SCENARIO_NAME = "Desktop (packaged) · the real bundle attaches to the OS-supervised daemon";
49

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected