# Exit on Option keystroke - MacOS Intel only builds

**URL:** <https://swi-prolog.discourse.group/t/exit-on-option-keystroke-macos-intel-only-builds/8727>\
**Category:** Help!\
**Created:** [January 13, 2025, 10:10pm UTC](https://swi-prolog.discourse.group/t/exit-on-option-keystroke-macos-intel-only-builds/8727 "2025-01-13T22:10:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ridgeworks](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/ridgeworks/32/886_2.png) [@ridgeworks](https://swi-prolog.discourse.group/u/ridgeworks)\
**Post date:** [January 13, 2025, 10:10pm UTC](https://swi-prolog.discourse.group/t/exit-on-option-keystroke-macos-intel-only-builds/8727/1 "2025-01-13T22:10:00Z")

</div>

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:

```prolog
$ /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):

```prolog
$ /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?

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [January 14, 2025, 8:46am UTC](https://swi-prolog.discourse.group/t/exit-on-option-keystroke-macos-intel-only-builds/8727/2 "2025-01-14T08:46:52Z")

</div>

☹ 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.

---

<div class="post-metadata">

**Author:** ![ridgeworks](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/ridgeworks/32/886_2.png) [@ridgeworks](https://swi-prolog.discourse.group/u/ridgeworks)\
**Post date:** [January 14, 2025, 2:53pm UTC](https://swi-prolog.discourse.group/t/exit-on-option-keystroke-macos-intel-only-builds/8727/3 "2025-01-14T14:53:15Z")

</div>

> [@jan](#):
>
> ☹ Its compiled from the same source … Can you try
> 
> ```prolog
> swipl --no-tty
> 
> ```
> 
> That disables using the 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.

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [January 14, 2025, 4:08pm UTC](https://swi-prolog.discourse.group/t/exit-on-option-keystroke-macos-intel-only-builds/8727/4 "2025-01-14T16:08:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ridgeworks](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/ridgeworks/32/886_2.png) [@ridgeworks](https://swi-prolog.discourse.group/u/ridgeworks)\
**Post date:** [January 14, 2025, 5:50pm UTC](https://swi-prolog.discourse.group/t/exit-on-option-keystroke-macos-intel-only-builds/8727/5 "2025-01-14T17:50:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [January 15, 2025, 8:18am UTC](https://swi-prolog.discourse.group/t/exit-on-option-keystroke-macos-intel-only-builds/8727/6 "2025-01-15T08:18:25Z")

</div>

> [@ridgeworks](#):
>
> 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`.
