Skip to content

rvagg/macos-term-size

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

macos-term-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

$ term-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
$ term-size
158
25
$ term-size &> x; cat x
158
25

Build

$ ./build

Related

  • term-size - Get the terminal window size, cross-platform (Uses this binary)
  • win-term-size - Get the terminal window size on Windows

License

MIT © Sindre Sorhus

About

Get the terminal window size on macOS

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 87.2%
  • Shell 12.8%