R/term_height.R

Defines functions term_height

Documented in term_height

#' Get the height of the terminal window in pixels
#'
#' @return
#' An integer with the number of pixels the terminal is high. This value can be
#' zero when the terminal does not support querying the size.
#'
#' @seealso
#' \code{\link{term_width}} for the terminal width and \code{\link{term_dim}}
#' for all dimensions including the dimensions in rows and columns.
#'
#' @export
term_height <- function() {
  term_dim()[2] |> as.vector()
}

Try the terminalgraphics package in your browser

Any scripts or data that you put into this service are public.

terminalgraphics documentation built on Aug. 28, 2025, 9:09 a.m.