Link Search Menu Expand Document

Term

Table of contents

  1. Term
    1. Term.isatty(number)
    2. Term.getSize()

Term

To make use of the Term module an import is required.

import Term;

Term.isatty(number)

Returns a boolean indicating whether the file descriptor passed is attached to a tty.

Term.isatty(0);

Term.getSize()

Returns the number of rows, columns, horizontal and vertical pixels of the attached terminal.

Term.getSize();
print(Term.getSize());
// {"rows": 13, "columns": 145, "horizontal_pixels": 145, "vertical_pixels": 145}

This site uses Just The Docs, with modifications.