Module CCFormat.ANSI_codes
ANSI escape codes. This contains lower level functions for them.
- since
- 3.5
type style=[|`FG of colorforeground
|`BG of colorbackground
|`Bold|`Reset]A style. Styles can be composed in a list.
val clear_line : stringclear_lineis an escape code to clear the current line. It is very useful for progress bars; for example:let pp_progress i = Printf.printf "%sprogress at %d%!" ANSI_codes.clear_line iif called repeatedly this will print successive progress messages on a single line.
val string_of_style : style -> stringstring_of_style stis an escape code to set the current style tost. It can be printed as is on any output that is a compatible terminal.
val string_of_style_list : style list -> stringstring_of_style_list stylesis an escape code for multiple styles at once. For examplestring_of_style_list ANSI_codes.([`FG `Red; `BG `Green; `Bold])is a very shiny style.