Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sindresorhus/macos-terminal-size
Get the terminal window size on macOS
https://github.com/sindresorhus/macos-terminal-size
c columns macos rows size terminal tty
Last synced: about 1 month ago
JSON representation
Get the terminal window size on macOS
- Host: GitHub
- URL: https://github.com/sindresorhus/macos-terminal-size
- Owner: sindresorhus
- License: mit
- Created: 2017-05-06T17:07:43.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2023-11-04T18:05:45.000Z (about 1 year ago)
- Last Synced: 2024-05-22T18:06:46.504Z (6 months ago)
- Topics: c, columns, macos, rows, size, terminal, tty
- Language: C
- Homepage:
- Size: 7.81 KB
- Stars: 39
- Watchers: 7
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# macos-terminal-size
> Get the terminal window size on macOS
Works even when run [non-interactively](http://www.tldp.org/LDP/abs/html/intandnonint.html), for example, in a child process or when piped.
## Install
[Download](https://github.com/sindresorhus/macos-terminal-size/releases/latest) 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
```sh
./build
```## Related
- [terminal-size](https://github.com/sindresorhus/terminal-size) - Get the terminal window size, cross-platform
- [windows-terminal-size](https://github.com/sindresorhus/windows-terminal-size) - Get the terminal window size on Windows