# Exiting consult mode

**URL:** https://swi-prolog.discourse.group/t/exiting-consult-mode/3028
**Category:** Nice to know
**Created:** [October 11, 2020, 2:23pm UTC](https://swi-prolog.discourse.group/t/exiting-consult-mode/3028 "2020-10-11T14:23:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)
#### Post date: [October 11, 2020, 2:23pm UTC](https://swi-prolog.discourse.group/t/exiting-consult-mode/3028/1 "2020-10-11T14:23:32Z")

</div>

Consult mode is used to enter facts and predicates at the top level.

```prolog
?- [user].
|: likes(mary, john).
|: end_of_file.

```

Many times you will see `^D` (Ctrl-D) use to exit consult mode, however `end_of_file.` will also work and be less confusing.

---

<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: [October 11, 2020, 2:51pm UTC](https://swi-prolog.discourse.group/t/exiting-consult-mode/3028/2 "2020-10-11T14:51:19Z")

</div>

True, but is it more typing ☹ IMHO, consulting `user` is hardly ever a good idea. If you just want to add a single simple clause, use assertz/1. Else create a file and load it. That is much easier to handle, in particular if you find you made a mistake and want to correct the code.

---

<div class="post-metadata">

### Author: ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)
#### Post date: [October 11, 2020, 3:12pm UTC](https://swi-prolog.discourse.group/t/exiting-consult-mode/3028/3 "2020-10-11T15:12:40Z")

</div>

I agree.

Lately I am seeing more responses, here and on other sites, that are using the consult mode to enter data and then using `^D` to exit consult mode. For those new to coding and entering code, the `^D` has them very confused. 🙂
