HomeManualTopicsTypesSymbols

std::initialize_terminal

creates a terminal object for the given input file descriptor

Parameters

options*
the options to use
body
the function to call

Results

None

Description

If no file descriptor is given, the function uses the standard input.

The supplied options are used to configure the terminal.

Possible options are:

  • TEXT_COLOUR: specify the initial text colour

  • BACKGROUND_COLOUR: specify the initial background colour

  • FILE_DESCRIPTOR: explicitly specify the file descriptor

  • RECEIVE_CTRL_C_AND_CTRL_Z: specify that the terminal should receive ctrl-c and ctrl-z

  • RECEIVE_CTRL_Q_AND_CTRL_S: specify that the terminal should receive ctrl-q and ctrl-s

  • MAP_CR: specify that the terminal should map carriage returns to line feeds

  • RECEIVE_SIGWINCH: specify that the terminal should receive window resize events

  • CURSOR_OFF: specify that the cursor should be initially turned off

  • TITLE: specify the title to use for the terminal window

    After successfull initialization the function calls body with the std_types::terminal object as its sole argument.

    When body returns, the function undoes all changes made to the terminal window.

    Example

    initialize_terminal! TEXT_COLOUR = RED BACKGROUND_COLOUR = BLACK TITLE = "My Terminal" : (terminal) draw_text &terminal 10 5 "Hello, world!" update_terminal &terminal $output # create output character stream print! output # print the generated character stream

    Topic

    Terminal

    See also

    std::create_terminal must be called before any other terminal function