https://github.com/sindresorhus/windows-terminal-size
Get the terminal window size on Windows
https://github.com/sindresorhus/windows-terminal-size
c columns rows size terminal tty windows
Last synced: 7 months ago
JSON representation
Get the terminal window size on Windows
- Host: GitHub
- URL: https://github.com/sindresorhus/windows-terminal-size
- Owner: sindresorhus
- License: mit
- Created: 2016-09-09T16:00:15.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2023-11-04T18:11:07.000Z (over 2 years ago)
- Last Synced: 2025-01-28T19:28:20.922Z (over 1 year ago)
- Topics: c, columns, rows, size, terminal, tty, windows
- Language: C
- Homepage:
- Size: 2.93 KB
- Stars: 12
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# windows-terminal-size
> Get the terminal window size on Windows
Works even when run [non-interactively](https://www.tldp.org/LDP/abs/html/intandnonint.html), for example, in a child process or when piped.
## Install
[Download](https://github.com/sindresorhus/windows-terminal-size/releases/latest) the binary and put it somewhere in your [`%path%`](https://stackoverflow.com/a/28778358/64949).
## Usage
```
$ terminal-size
143
24
```
Where `143` are the number of columns and `24` are the number of rows.
## Build
Install [`MinGW-w64`](https://sourceforge.net/projects/mingw-w64/) and run:
```sh
build
```
## Related
- [terminal-size](https://github.com/sindresorhus/terminal-size) - Get the terminal window size, cross-platform
- [macos-terminal-size](https://github.com/sindresorhus/macos-terminal-size) - Get the terminal window size on macOS