getTerminalSize - SeqAn API Documentation

# fn() getTerminalSize
Retrieve size of terminal.

Defined in | <seqan/misc/terminal.h>
Signature | `bool getTerminalSize(cols, rows);`

## Parameters

`cols` | An `unsigned` value the column count is written to.
`rows` | An `unsigned` value the row count is written to.

## Return Values

`bool` | true on success, false otherwise.

## Detailed Description

### Remarks

On Windows, `rows` contains the number o frows in the terminal buffer, not the window.

### Examples

The following demonstrates the usage.

    #include <iostream>

    #include <seqan/misc/terminal.h>

    using namespace seqan2;

    int main()
    {
        // Get terminal size and print it to stdout.
        unsigned cols = 0, rows = 0;
        getTerminalSize(cols, rows);
        std::cout << "cols == " << cols << ", rows == " << rows << "\n";

        return 0;
    }

Demo: demos/dox/misc/get_terminal_size.cpp

## Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

## See Also

- isAnsiColorTerminal
- isTerminal

#### Dox Sources

    /*!
     * @fn getTerminalSize
     *
     * @headerfile <seqan/misc/terminal.h>
     *
     * @brief Retrieve size of terminal.
     *
     * @signature bool getTerminalSize(cols, rows);
     *
     * @param[out] cols An <tt>unsigned</tt> value the column count is written to.
     * @param[out] rows An <tt>unsigned</tt> value the row count is written to.
     *
     * @return bool true on success, false otherwise.
     *
     * @section Remarks
     *
     * On Windows, <tt>rows</tt> contains the number o frows in the terminal
     * <b>buffer</b>, not the window.
     *
     * @section Examples
     *
     * The following demonstrates the usage.
     *
     * @include demos/dox/misc/get_terminal_size.cpp
     *
     * @see isTerminal
     * @see isAnsiColorTerminal
     */