term
Version, currently main branch1 version
- main branchlatestFeb 12, 2026
github.com/bmmcginty/term
terminal library for crystal
3 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
term:
github: bmmcginty/term
branch: mainmain is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
>= 1.19- License
- MIT
- Author
- Brandon McGinty - Tyler Spivey
Dependencies
Runtime Dependencies
- libtermkey-cr*github: bmmcginty/libtermkey-cr
README
term
A library for easily writing text user interfaces.
Installation
Add this to your application's shard.yml:
dependencies:
term:
github: bmmcginty/term
Usage
require "./src/term"
w=MainWindow.new
tc=EditControl.new text: "00:00:00", height: 1
w.add tc
w.run
while 1
tc.text=Time.local.to_s("%H:%M:%S")
w.refresh
sleep 1
end
Testing
Specs will be added, and results will be validated by way of full screen dumps.
Development
add controls to src/controls/control_name.cr. Writing code for controls is the most time consuming task at this point. Each control should:
- provide focusable? to determine if a user can interact with it directly
- provide key(k) to accept keys
- provide a string via the text method to be used when rendering the control
- set user_x and/or user_y as appropriate when the user moves around the control
- set dirty to true when content or cursor position changes Controls should not use boarders. If you wish to add boarders or anything that isn't purely text, those elements should be toggleable, and set to disabled by default.
Contributing
- Fork it ( https://github.com/bmmcginty/term/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
Contributors
- bmmcginty Brandon McGinty - creator, maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
main- Seen
- Feb 12, 2026
- Crystal
>= 1.19- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/bmmcginty/term
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 14, 2026
- Synced
- Aug 14, 2026
- Versions
- 1