Exit on Option keystroke - MacOS Intel only builds

Starting with the Intel only build of 9.2.0 for MacOS, typing an extended character using the Option- key causes an immediate exit from swipl running from the MacOS terminal.

Intel only build:

$ /Applications/SWI-Prolog9.2.0.app/Contents/MacOS/swipl
Welcome to SWI-Prolog (threaded, 64 bits, version 9.2.0)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- X=`
% halt
$ ?

so immediate exit on keystroke. This seems to happen on any “Option-” keystroke I’ve tried.

On “fat” binary build (same release):

$ /Applications/SWI-Prolog9.2.0fat.app/Contents/MacOS/swipl
Welcome to SWI-Prolog (threaded, 64 bits, version 9.2.0)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- X = ç.
X = ç.

?- X=`ç`.
X = [231].

?- halt.
$

Can anybody verify?

:frowning: Its compiled from the same source … Can you try

swipl --no-tty

That disables using the command line editor. You could also try in init.pl to put

:- set_prolog_flag(readline, readline).

To use GNU readline instead of MacOS editline as command line editor.

Using the --no-tty option fixes the problem.

Setting the Prolog flag readline as suggested in ~/.config/swi-prolog/init.pl file also does the job.

I’m good with this; you can decide if any further action is required.

1 Like

I think I leave it. It seems something is wrong with libedit, but that is from Apple.

I guess with the Intel only version of the library in particular. It’s interesting that I can type these characters into the MacOS terminal program without causing the problem.

I’m also guessing that problem is due to the library generating some unexpected signal, since swipl manages to output an “information” message before halting.

My suspicion is that Prolog gets an end-of-file from the edit library. That is why the REPL simply exists using % halt.