isHeadless

fnbool isHeadless() nothrow

Checks if running in a headless environment.

This is useful for skipping GUI-dependent tests in CI environments. The function actually tries to connect to the X display and initialize FLTK to verify the GUI subsystem is functional.

In unittest builds, defaults to headless mode unless FLTK_HEADLESS=0 is explicitly set. This avoids shutdown crashes caused by D GC and FLTK cleanup order conflicts.

Returns

true if no display is available or FLTK_HEADLESS=1 (or unset in unittest)