Did you know ... Search Documentation:
Predicate has_display/0
 has_display is semidet[private]
True when we can run graphics. Graphics are always available on Windows or MacOS (although they may appear on the main console when invoked from a remote login). On Linux, we can detect DISPLAY (X11) or WAYLAND_DISPLAY (Wayland). We also assume we can run graphics if the SDL_VIDEO_DRIVER is set to dummy, implying we try to run headless.