private TerminalSize queryTerminalSize() {
    String sizeString = doStty("size");

    int rows = 0;
    int columns = 0;

    StringTokenizer tokenizer = new StringTokenizer(sizeString);
    int rc = Integer.parseInt(tokenizer.nextToken());
    if (rc > 0) {
      rows = rc;
    }

    rc = Integer.parseInt(tokenizer.nextToken());
    if (rc > 0) {
      columns = rc;
    }
    return new TerminalSize(columns, rows);
  }
An implementation of the {@link Terminal} interface for normal display mode. This implementation
produces output intended for human viewing. In particular, it only displays one screenful of
data. The output contains some escape sequences for formatting.
hbase-hbtop/src/main/java/org/apache/hadoop/hbase/hbtop/terminal/impl/TerminalImpl.java