Did you know ... Search Documentation:
Pack ansi_termx -- prolog/ansi_termx.pl
PublicShow source

This module provides predicates for manipulating ANSI terminals. It doesn't aim to cover all of the features, focusing on functionality for fancier output. The extra x at the end of the package name aims to disambiguate the SWI-Prolog library library(ansi_term).

author
- Can Bican
See also
- library(ansi_term)
license
- BSD 2-clause
 clear_all_tabs is det
Clear all tabs
 clear_screen is det
Clear the screen and move cursor to topleft of the screen
 clear_tab is det
Clear the tab on the current cursor position
 color(-Color:atom) is multi
Enumerates available colors.
Arguments:
Color- is a valid color
 color(+Color:atom, +Background:atom, +Styles:list(atom), +Input:any, -Output:string) is semidet
Generates text of input with a style.
Arguments:
Color- is one of default, black, red, green, yellow, blue, magenta, cyan, white, bright_black, bright_red, bright_green, bright_yellow, bright_blue, bright_magenta, bright_cyan or bright_white.
Background- is one of default, black, red, green, yellow, blue, magenta, cyan, white, bright_black, bright_red, bright_green, bright_yellow, bright_blue, bright_magenta, bright_cyan or bright_white.
Styles- is one or more of default, bold, dim, italic, underline, reverse or crossed_out.
Input- is any kind of variable that can be fed to ~w modifier of format/3.
Output- is the resulting string that can be printed by printing predicate.
 cursor_move(+Count:int, +Direction:atom) is semidet
Relative cursor movement.
Arguments:
Count- is number of steps to move in Direction.
Direction- is one of up, down, forward or backward.
 cursor_position(?Row:int, ?Column:int) is det
Queries and sets the cursor position.
Arguments:
Row- is the row of the screen. It can be queried or set.
Column- is the column of the screen. It can be queried or set.
 cursor_save is det
Saves the current position of the cursor, to be retrieved later by cursor_unsave/0.
 cursor_unsave is det
Restores the current position of the cursor, previously saved by cursor_save/0.
 reset is det
Resets the terminal
 screen_size(-Rows:int, -Columns:int) is det
Determines the screen size.
Arguments:
Rows- is the height of the current terminal.
Columns- is the width of the current terminal.
 scroll(+Lines:int, +Direction:atom) is semidet
Scrolls the screen up or down, depending on the direction.
Arguments:
Lines- number of lines to scroll
Direction- up or down
 set_tab is det
Set a tab on the current cursor position
 style(-Style:atom) is multi
Enumerates all styles.
Arguments:
Style- is a valid style