fn() getTerminalSize
Retrieve size of terminal.

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


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


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


The following demonstrates the usage.

#include <iostream>

#include <seqan/misc/terminal.h>

using namespace seqan;

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;

Data Races

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

See Also