NixOS Test Driver: Open Qemu with graphical output in driver interactive mode also on macOS (#391589)

This commit is contained in:
Robert Hensing
2025-03-24 10:20:05 +00:00
committed by GitHub
@@ -1,6 +1,7 @@
import base64
import io
import os
import platform
import queue
import re
import select
@@ -199,7 +200,13 @@ class StartCommand:
allow_reboot: bool = False,
) -> str:
display_opts = ""
display_available = any(x in os.environ for x in ["DISPLAY", "WAYLAND_DISPLAY"])
if platform.system() == "Darwin":
# We have no DISPLAY variables on macOS and seemingly no better way
# to find out
display_available = "TERM_PROGRAM" in os.environ
if not display_available:
display_opts += " -nographic"