Since a while I notice that app bundle for SWI-Prolog on MacOS fails to use the XPCE based IDE tools. I think this is since the “Big Sur” update, but I’m not sure. The problem is that running ?- edit.
or ?- emacs.
(and basically anything using xpce graphics) does not return. It just sits there without using CPU. You can’t even kill it through the menus; only an explicit kill PID
from the commandline helps.
A little debugging shows it starts but never finished opening the X11 display. The bundled command line version (in SWI-Prolog.app/Contents/MacOS/swipl
) works fine. Even weirder, SWI-Prolog.app/Contents/MacOS/SWI-Prolog
also runs fine. I.e., it only fails when the app is started by double clicking it and works fine when started from the command line.
Is that only me? Some clue from Mac users?
edit The commandline sets DISPLAY to :0
, while the app has DISPLAY set to /private/tmp/com.apple.launchd.RyPYUPvSJO/org.macosforge.xquartz:0
. Setting DISPLAY to the app value from the command line makes this fail too, while setting it to :0
in the app makes the IDE work. So, the poor mens work-around is this, which one can also put in ~/.config/swi-prolog/init.pl
(using :-
instead of the ?-
prompt)
?- setenv('DISPLAY', ':0').