| Did you know ... | Search Documentation: |
| Predicate message_line_element/2 |
[semidet,multifile]prolog:message_line_element(+Stream,
+Term)nl(Ctx), flush(Ctx)\e[K` (Erase in Line)
such that the coloured block extends to the right margin.nl. Resetting matters because a terminal that
scrolls while a background colour is in effect paints the newly exposed
line with it.Ctx is the message context. It is created by the handler for begin/2 as a term
ansi(Reset, ReInstall, EraseEol)
where Reset is the sequence written by end/1,
ReInstall is a Format-Args pair that re-installs the attributes of the
message and EraseEol is the sequence that paints the remainder of the
line or the empty atom. Callers must treat Ctx as opaque. It is left
unbound if Stream is not a terminal, if the color_term
flag is
false or if the message has no attributes. All handlers
that use Ctx therefore fail if it is unbound, which makes
print_message_lines/3
fall back to writing plain text.
prolog:message_line_element(+Stream,
+Term)library(ansi_term) to colour messages on ANSI-capable
terminals. If it fails, print_message_lines/3
prints Term itself, ignoring any decoration. Note that the
elements that carry the context established by begin(Class,
Context) are passed to this hook in their long form, e.g., nl(Context)
rather than nl. See
print_message_lines/3
for the details.