Skip to content

Support for getting terminal width & height #50

Open
@richard-uk1

Description

@richard-uk1

Getting the terminal width and height is something you cannot do presently with the Terminal trait. It prevents implementation of something like termbox on top of Terminal trait.

The linux implementation looks something like (from termbox)

    struct winsize sz;
    memset(&sz, 0, sizeof(sz));

    ioctl(inout, TIOCGWINSZ, &sz);

    termw = sz.ws_col;
    termh = sz.ws_row;

whilst in windows the relevant function is kernel32::GetConsoleScreenBufferInfo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions