fn() getTerminalSize
Retrieve size of terminal.

Defined in <seqan/misc/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/misc_terminal.h>

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

    return 0;

See Also