# How do I make a line wrap using print/1 in the console window?

**URL:** <https://swi-prolog.discourse.group/t/how-do-i-make-a-line-wrap-using-print-1-in-the-console-window/967>\
**Category:** Help!\
**Created:** [July 17, 2019, 9:28pm UTC](https://swi-prolog.discourse.group/t/how-do-i-make-a-line-wrap-using-print-1-in-the-console-window/967 "2019-07-17T21:28:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![prodog](https://avatars.discourse-cdn.com/v4/letter/p/57b2e6/32.png) [@prodog](https://swi-prolog.discourse.group/u/prodog)\
**Post date:** [July 17, 2019, 9:28pm UTC](https://swi-prolog.discourse.group/t/how-do-i-make-a-line-wrap-using-print-1-in-the-console-window/967/1 "2019-07-17T21:28:50Z")

</div>

I’m using: SWI-Prolog version 8.1.9.

Up until now I’ve been using `write/1` and `nl/0` to generate console output. Now I am using `print/1` since I am experimenting with `portray/1`. I tried using:

```prolog
print('\n')

```

To wrap to a new line like `nl/0` does, but instead I see the literal string `\n` in the console output.

How can I get console output to wrap using `print/1`?

_Also_, I noticed that when I toggle output to a file using the `protocol/0` command, my `portray/1` predicates _no longer get called_ and I see the plain dump of the term in the generated trace log file instead of my formatted print of the portrayed term. How can I get `portray/1` to work while I am outputting trace/console messages to a file? (i.e. - `protocolling/0` succeeds.)

---

<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:** [July 18, 2019, 8:30am UTC](https://swi-prolog.discourse.group/t/how-do-i-make-a-line-wrap-using-print-1-in-the-console-window/967/2 "2019-07-18T08:30:30Z")

</div>

You can’t. Quoted write escapes special characters in quoted atoms and strings. Probably [print\_term/2](https://www.swi-prolog.org/pldoc/doc_for?object=prolog_pretty_print%3Aprint_term/2) is what you are looking for.
