https://github.com/piotrmurach/tty-screen
Terminal screen detection - cross platform, major ruby interpreters
https://github.com/piotrmurach/tty-screen
Keywords
cli columns console lines rows ruby size terminal tty
Last synced: about 10 hours ago
JSON representation
Repository metadata
Terminal screen detection - cross platform, major ruby interpreters
- Host: GitHub
- URL: https://github.com/piotrmurach/tty-screen
- Owner: piotrmurach
- License: mit
- Created: 2014-11-23T22:04:16.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2025-04-05T21:16:44.000Z (8 months ago)
- Last Synced: 2025-12-13T08:56:07.376Z (1 day ago)
- Topics: cli, columns, console, lines, rows, ruby, size, terminal, tty
- Language: Ruby
- Homepage: https://ttytoolkit.org
- Size: 174 KB
- Stars: 91
- Watchers: 5
- Forks: 11
- Open Issues: 1
- Releases: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
README.md
TTY::Screen
Terminal screen size detection that works on Linux, macOS and Windows systems
and supports Ruby MRI, JRuby, TruffleRuby and Rubinius interpreters.
TTY::Screen provides a terminal screen size detection component for the
TTY toolkit.
Installation
Add this line to your application's Gemfile:
gem "tty-screen"
And then execute:
$ bundle
Or install it yourself as:
$ gem install tty-screen
1. Usage
Use the size method to detect terminal screen size. It will result in
a [height, width] array:
TTY::Screen.size # => [51, 280]
Use the width, columns or cols method to detect terminal screen width:
TTY::Screen.width # => 280
TTY::Screen.columns # => 280
TTY::Screen.cols # => 280
Use the height, lines or rows method to detect terminal screen height:
TTY::Screen.height # => 51
TTY::Screen.lines # => 51
TTY::Screen.rows # => 51
Development
After checking out the repo, run bin/setup to install dependencies.
Then, run rake spec to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
Contributing
- Fork it ( https://github.com/piotrmurach/tty-screen/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
License
The gem is available as open source under the terms of the
MIT License.
Code of Conduct
Everyone interacting in the TTY::Screen project's codebases, issue trackers,
chat rooms and mailing lists is expected to follow the
code of conduct.
Copyright
Copyright (c) 2014 Piotr Murach. See
LICENSE.txt
for further details.
Owner metadata
- Name: Piotr Murach
- Login: piotrmurach
- Email:
- Kind: user
- Description: Tender loving command line.
- Website: https://piotrmurach.com
- Location: Sheffield / Olsztyn
- Twitter: piotr_murach
- Company:
- Icon url: https://avatars.githubusercontent.com/u/444312?v=4
- Repositories: 89
- Last ynced at: 2025-11-23T03:03:05.684Z
- Profile URL: https://github.com/piotrmurach
GitHub Events
Total
- Issues event: 2
- Watch event: 5
- Issue comment event: 2
- Push event: 3
- Pull request review comment event: 1
- Pull request event: 1
- Fork event: 2
Last Year
- Issues event: 2
- Watch event: 3
- Issue comment event: 2
- Push event: 3
- Pull request review comment event: 1
- Pull request event: 1
- Fork event: 2
Committers metadata
Last synced: about 14 hours ago
Total Commits: 277
Total Committers: 6
Avg Commits per committer: 46.167
Development Distribution Score (DDS): 0.018
Commits in past year: 3
Committers in past year: 1
Avg Commits per committer in past year: 3.0
Development Distribution Score (DDS) in past year: 0.0
| Name | Commits | |
|---|---|---|
| Piotr Murach | p****h@g****m | 272 |
| Raffael Schmid | r****l@y****h | 1 |
| Marek Kowalcze | m****e@g****m | 1 |
| Alexey Nikitin | t****k@b****u | 1 |
| Tero Marttila | t****a@k****o | 1 |
| Igor Kapkov | i****k@m****m | 1 |
Committer domains:
- me.com: 1
- kontena.io: 1
- bohr.su: 1
- yux.ch: 1
Issue and Pull Request metadata
Last synced: 5 days ago
Total issues: 12
Total pull requests: 10
Average time to close issues: about 1 month
Average time to close pull requests: about 2 months
Total issue authors: 12
Total pull request authors: 8
Average comments per issue: 3.08
Average comments per pull request: 1.8
Merged pull request: 5
Bot issues: 0
Bot pull requests: 0
Past year issues: 1
Past year pull requests: 3
Past year average time to close issues: 21 days
Past year average time to close pull requests: 22 days
Past year issue authors: 1
Past year pull request authors: 2
Past year average comments per issue: 1.0
Past year average comments per pull request: 0.67
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- lucaskanashiro (1)
- SpComb (1)
- gomfucius (1)
- lgauthier (1)
- victor-varjo (1)
- aaronmallen (1)
- kke (1)
- 2maz (1)
- Vaidios (1)
- graaff (1)
- DannyBen (1)
- andyl (1)
Top Pull Request Authors
- balakine (2)
- aaronmallen (2)
- ingemar (1)
- tank-bohr (1)
- kowal (1)
- luxflux (1)
- SpComb (1)
- igas (1)
Top Issue Labels
- bug (3)
- enhancement (2)
Top Pull Request Labels
Package metadata
- Total packages: 4
-
Total downloads:
- rubygems: 395,495,020 total
- Total docker downloads: 1,003,544,642
- Total dependent packages: 97 (may contain duplicates)
- Total dependent repositories: 24,288 (may contain duplicates)
- Total versions: 63
- Total maintainers: 1
gem.coop: tty-screen
Terminal screen size detection that works on Linux, macOS and Windows systems and supports Ruby MRI, JRuby, TruffleRuby and Rubinius interpreters.
- Homepage: https://ttytoolkit.org
- Documentation: http://www.rubydoc.info/gems/tty-screen/
- Licenses: MIT
- Latest release: 0.8.2 (published almost 2 years ago)
- Last Synced: 2025-12-13T05:03:10.397Z (1 day ago)
- Versions: 20
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 197,830,467 Total
- Docker Downloads: 501,772,321
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.042%
- Downloads: 0.125%
- Maintainers (1)
-
Funding:
- https://github.com/sponsors/piotrmurach
rubygems.org: tty-screen
Terminal screen size detection that works on Linux, macOS and Windows systems and supports Ruby MRI, JRuby, TruffleRuby and Rubinius interpreters.
- Homepage: https://ttytoolkit.org
- Documentation: http://www.rubydoc.info/gems/tty-screen/
- Licenses: MIT
- Latest release: 0.8.2 (published almost 2 years ago)
- Last Synced: 2025-12-12T05:00:32.813Z (2 days ago)
- Versions: 20
- Dependent Packages: 96
- Dependent Repositories: 24,288
- Downloads: 197,664,553 Total
- Docker Downloads: 501,772,321
-
Rankings:
- Downloads: 0.159%
- Dependent repos count: 0.228%
- Docker downloads count: 0.246%
- Dependent packages count: 0.335%
- Average: 2.683%
- Stargazers count: 5.961%
- Forks count: 9.168%
- Maintainers (1)
-
Funding:
- https://github.com/sponsors/piotrmurach
proxy.golang.org: github.com/piotrmurach/tty-screen
- Homepage:
- Documentation: https://pkg.go.dev/github.com/piotrmurach/tty-screen#section-documentation
- Licenses: mit
- Latest release: v0.8.2 (published almost 2 years ago)
- Last Synced: 2025-12-12T05:00:34.976Z (2 days ago)
- Versions: 20
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Stargazers count: 4.833%
- Forks count: 6.637%
- Average: 7.962%
- Dependent packages count: 9.576%
- Dependent repos count: 10.802%
conda-forge.org: rb-tty-screen
- Homepage: https://rubygems.org/gems/tty-screen
- Licenses: MIT
- Latest release: 0.8.1 (published over 5 years ago)
- Last Synced: 2025-12-12T05:00:51.779Z (2 days ago)
- Versions: 3
- Dependent Packages: 1
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 28.82%
- Stargazers count: 32.603%
- Dependent repos count: 34.025%
- Average: 35.026%
- Forks count: 44.657%
Dependencies
- coveralls_reborn ~> 0.22.0
- io-console >= 0
- rspec-benchmark ~> 0.6.0
- simplecov ~> 0.21.0
- yardstick ~> 0.9.9
- rake >= 0 development
- rspec >= 3.0 development
- actions/checkout v2 composite
- ruby/setup-ruby v1 composite
Score: 27.37261830261871