• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • CPACK
    • Home
    • List packs
    • Submit pack
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
    • SWISH Prolog shell
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

/usr/lib/swipl/library/ansi_term.pl
All Application Manual Name SummaryHelp

  • swipl
    • library
      • error.pl
      • debug.pl -- Print debug messages and test assertions
      • apply.pl
      • lists.pl -- List Manipulation
      • broadcast.pl -- Event service
      • shlib.pl -- Utility library for loading foreign objects (DLLs, shared objects)
      • option.pl -- Option list processing
      • thread_pool.pl
      • gensym.pl -- Generate unique symbols
      • settings.pl
      • arithmetic.pl
      • main.pl
      • readutil.pl
      • operators.pl -- Manage operators
      • pairs.pl
      • prolog_source.pl
      • quasi_quotations.pl -- Define Quasi Quotation syntax
      • url.pl
      • www_browser.pl
      • prolog_colour.pl -- Prolog syntax colouring support.
      • record.pl
      • prolog_xref.pl -- Prolog cross-referencer data collection
      • occurs.pl -- Finding and counting sub-terms
      • ordsets.pl
      • assoc.pl -- Binary associations
      • ugraphs.pl
      • solution_sequences.pl
      • atom.pl
      • prolog_pack.pl
      • git.pl
      • ctypes.pl
      • utf8.pl
      • base64.pl -- Base64 encoding and decoding
      • persistency.pl
      • pure_input.pl -- Pure Input from files and streams
      • nb_set.pl
      • aggregate.pl
      • csv.pl
      • iostream.pl -- Utilities to deal with streams
      • dialect.pl
      • apply_macros.pl -- Goal expansion rules to avoid meta-calling
      • yall.pl
      • prolog_code.pl -- Utilities for reasoning about code
      • dif.pl -- The dif/2 constraint
      • thread.pl -- High level thread primitives
      • predicate_options.pl
      • rbtrees.pl -- Red black trees
      • nb_rbtrees.pl -- Non-backtrackable operations on red black trees
      • sandbox.pl -- Sandboxed Prolog code
      • prolog_format.pl
      • random.pl -- Random numbers
      • pprint.pl -- Pretty Print Prolog terms
      • modules.pl -- Module utility predicates
      • lazy_lists.pl -- Lazy list handling
      • edinburgh.pl -- Some traditional Edinburgh predicates
      • prolog_clause.pl
      • prolog_breakpoints.pl -- Manage Prolog break-points
      • dicts.pl
      • backcomp.pl
      • oset.pl
      • charsio.pl -- I/O on Lists of Character Codes
      • make.pl -- Reload modified source files
      • threadutil.pl -- Interactive thread utilities
      • quintus.pl -- Quintus compatibility
      • date.pl -- Process dates and times
      • prolog_autoload.pl
      • check.pl
      • prolog_codewalk.pl -- Prolog code walker
      • terms.pl
      • tableutil.pl
      • prolog_stack.pl
      • prolog_history.pl
      • prolog_config.pl
      • ansi_term.pl -- Print decorated text to ANSI consoles
        • ansi_format/3
        • ansi_format/4
        • ansi_sgr/2
        • ansi_hyperlink/2
        • ansi_hyperlink/3
        • tty_url_hook/2
        • ansi_get_color/2
        • console_color/3
        • console_color/2
        • theme_base/2
        • message_line_element/2
      • listing.pl -- List programs and pretty print clauses
      • prolog_profile.pl -- Execution profiler
      • help.pl -- Text based manual
      • wfs.pl
      • qsave.pl
      • zip.pl
      • codesio.pl -- I/O on Lists of Character Codes
      • varnumbers.pl -- Utilities for numbered terms
      • prolog_debug.pl -- User level debugging tools
      • portray_text.pl -- Portray text
      • base32.pl
      • coinduction.pl -- Co-Logic Programming
      • heaps.pl
      • sort.pl
      • statistics.pl -- Get information about resource usage
      • when.pl -- Conditional coroutining
      • prolog_trace.pl
      • exceptions.pl
      • strings.pl
      • tables.pl -- XSB interface to tables
      • prolog_wrap.pl -- Wrapping predicates
      • intercept.pl
      • optparse.pl
      • edit.pl
      • rwlocks.pl
      • writef.pl
      • prolog_versions.pl
      • prolog_coverage.pl -- Coverage analysis tool
      • prolog_metainference.pl
      • hashtable.pl -- Hash tables
      • increval.pl -- Incremental dynamic predicate modification
      • shell.pl
      • files.pl
      • prolog_jiti.pl
      • explain.pl
      • macros.pl
      • fastrw.pl
      • tty.pl
      • streams.pl -- Manage Prolog streams
      • prolog_qlfmake.pl -- Compile the library to QLF format
      • system.pl
 prolog:message_line_element(+Stream, +Term) is semidet[multifile, library(ansi_term)]
Hook implementation that colours the message elements produced by print_message_lines/3. Handled elements are:
ansi(Class, Fmt, Args)
ansi(Class, Fmt, Args, Ctx)
Write Fmt/Args using the attributes of Class. As the element ends with a full reset, the 4th argument version re-installs the decoration of the message as a whole afterwards.
url(Location)
url(URL, Label)
Write a hyperlink. See ansi_hyperlink/2,3. Label is an atom or string, a Format-Args pair or an ansi/3 or ansi/4 term. The latter combines a hyperlink with a style class.
begin(Class, Ctx)
end(Ctx)
Decorate the message as a whole. See below.
nl(Ctx),flush(Ctx)
End a line. If the message has a background colour, the remainder of the line is painted using `\e[K` (Erase in Line) such that the coloured block extends to the right margin.
eol(Ctx)
As above, but also reset the attributes: this ends the decorated part of the line. A message uses this for its last line if that line is not ended using 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.

ClioPatria (version V3.1.1-51-ga0b30a5)