SWI-Prolog.app on MacOS: no IDE tools

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').

As a suggestion, have tried to reinstall XQuartz?

No. As a Linux user my experience is that reinstalling stuff rarely helps :slight_smile: But, I did as you advised and despite it is the same version as I had before, reinstalling and rebooting fixed the problem. Thanks!

IMO, when upgrading to Big Sur, the pipe “/private/tmp/com.apple.launchd.RyPYUPvSJO/org.macosforge.xquartz:0” was somehow broken; by reinstalling it was recreated.