toml_terminal Derived Type

type, public :: toml_terminal

Terminal wrapper to handle color escape sequences, must be initialized with color support to provide colorful output. Default and uninitialized instances will remain usable but provide only stubs and do not produce colorful output. This behavior is useful for creating applications which can toggle color support.


Components

Type Visibility Attributes Name Initial
type(ansi_code), public :: bg_black = ansi_code()
type(ansi_code), public :: bg_blue = ansi_code()
type(ansi_code), public :: bg_bright_blue = ansi_code()
type(ansi_code), public :: bg_bright_cyan = ansi_code()
type(ansi_code), public :: bg_bright_green = ansi_code()
type(ansi_code), public :: bg_bright_magenta = ansi_code()
type(ansi_code), public :: bg_bright_red = ansi_code()
type(ansi_code), public :: bg_bright_white = ansi_code()
type(ansi_code), public :: bg_bright_yellow = ansi_code()
type(ansi_code), public :: bg_cyan = ansi_code()
type(ansi_code), public :: bg_gray = ansi_code()
type(ansi_code), public :: bg_green = ansi_code()
type(ansi_code), public :: bg_magenta = ansi_code()
type(ansi_code), public :: bg_red = ansi_code()
type(ansi_code), public :: bg_white = ansi_code()
type(ansi_code), public :: bg_yellow = ansi_code()
type(ansi_code), public :: black = ansi_code()
type(ansi_code), public :: blink = ansi_code()
type(ansi_code), public :: blink_rapid = ansi_code()
type(ansi_code), public :: blue = ansi_code()
type(ansi_code), public :: bold = ansi_code()
type(ansi_code), public :: bright_blue = ansi_code()
type(ansi_code), public :: bright_cyan = ansi_code()
type(ansi_code), public :: bright_green = ansi_code()
type(ansi_code), public :: bright_magenta = ansi_code()
type(ansi_code), public :: bright_red = ansi_code()
type(ansi_code), public :: bright_white = ansi_code()
type(ansi_code), public :: bright_yellow = ansi_code()
type(ansi_code), public :: crossed = ansi_code()
type(ansi_code), public :: cyan = ansi_code()
type(ansi_code), public :: dim = ansi_code()
type(ansi_code), public :: gray = ansi_code()
type(ansi_code), public :: green = ansi_code()
type(ansi_code), public :: hidden = ansi_code()
type(ansi_code), public :: italic = ansi_code()
type(ansi_code), public :: magenta = ansi_code()
type(ansi_code), public :: red = ansi_code()
type(ansi_code), public :: reset = ansi_code()
type(ansi_code), public :: reverse = ansi_code()
type(ansi_code), public :: underline = ansi_code()
type(ansi_code), public :: white = ansi_code()
type(ansi_code), public :: yellow = ansi_code()

Constructor

public interface toml_terminal

Constructor to create new terminal

  • private pure function new_terminal(use_color) result(new)

    Create new terminal

    Arguments

    Type IntentOptional Attributes Name
    logical, intent(in) :: use_color

    Enable color support in terminal

    Return Value type(toml_terminal)

    New terminal instance


Source Code

   type :: toml_terminal
      type(ansi_code) :: &
         reset = ansi_code(), &
         bold = ansi_code(), &
         dim = ansi_code(), &
         italic = ansi_code(), &
         underline = ansi_code(), &
         blink = ansi_code(), &
         blink_rapid = ansi_code(), &
         reverse = ansi_code(), &
         hidden = ansi_code(), &
         crossed = ansi_code()

      type(ansi_code) :: &
         black = ansi_code(), &
         red = ansi_code(), &
         green = ansi_code(), &
         yellow = ansi_code(), &
         blue = ansi_code(), &
         magenta = ansi_code(), &
         cyan = ansi_code(), &
         white = ansi_code(), &
         gray = ansi_code(), &
         bright_red = ansi_code(), &
         bright_green = ansi_code(), &
         bright_yellow = ansi_code(), &
         bright_blue = ansi_code(), &
         bright_magenta = ansi_code(), &
         bright_cyan = ansi_code(), &
         bright_white = ansi_code()

      type(ansi_code) :: &
         bg_black = ansi_code(), &
         bg_red = ansi_code(), &
         bg_green = ansi_code(), &
         bg_yellow = ansi_code(), &
         bg_blue = ansi_code(), &
         bg_magenta = ansi_code(), &
         bg_cyan = ansi_code(), &
         bg_white = ansi_code(), &
         bg_gray = ansi_code(), &
         bg_bright_red = ansi_code(), &
         bg_bright_green = ansi_code(), &
         bg_bright_yellow = ansi_code(), &
         bg_bright_blue = ansi_code(), &
         bg_bright_magenta = ansi_code(), &
         bg_bright_cyan = ansi_code(), &
         bg_bright_white = ansi_code()
   end type toml_terminal