sindresorhus
macos-terminal-size
C

Get the terminal window size on macOS

Last updated May 7, 2026
43
Stars
5
Forks
0
Issues
0
Stars/day
Attention Score
5
Language breakdown
No language data available.
โ–ธ Files click to expand
README

macos-terminal-size

Get the terminal window size on macOS

Works even when run non-interactively, for example, in a child process or when piped.

Install

Download the binary and put it in /usr/local/bin.

Usage

$ terminal-size
143
24

Where 143 are the number of columns and 24 are the number of rows.

Comparison

$ tput cols
158
$ tput cols &> x; cat x
80
$ terminal-size
158
25
$ terminal-size &> x; cat x
158
25

Build

./build

Related

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท sindresorhus/macos-terminal-size ยท Updated daily from GitHub