1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-07 11:05:30 +03:00

NixOS Test driver: Display Qemu windows on macOS in interactive mode

This commit is contained in:
Jacek Galowicz 2025-03-20 15:36:33 +00:00
parent 01fd8b0355
commit 482beabbbd

View file

@ -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"