https://github.com/tenderlove/termtime
Pure Ruby terminfo library
https://github.com/tenderlove/termtime
ascii terminal terminfo
Last synced: 4 months ago
JSON representation
Pure Ruby terminfo library
- Host: GitHub
- URL: https://github.com/tenderlove/termtime
- Owner: tenderlove
- License: apache-2.0
- Created: 2024-12-19T21:23:13.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-19T21:50:54.000Z (over 1 year ago)
- Last Synced: 2024-12-19T22:41:44.522Z (over 1 year ago)
- Topics: ascii, terminal, terminfo
- Language: Ruby
- Homepage:
- Size: 875 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# TermTime
TermTime is a pure Ruby terminfo library. You can use it to get information
about your terminal, and print cool stuff!
Here is an example that prints random colored characters to your display:
```ruby
require "termtime"
require "io/console"
tty = IO.console
y, x = tty.winsize
trap("WINCH") { y, x = tty.winsize }
ti = TermTime::TermInfo.new
begin
loop do
print ti.str("cup").tparm(rand(y), rand(x))
print ti.str("setaf").tparm(rand(255))
print "#"
sleep 0.01
end
ensure
print ti.str("sgr0").value
puts
end
```
Running the above program will make your terminal look something like this:
