Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bash-bastion/bash-term
Bash library for terminal escape sequences.
https://github.com/bash-bastion/bash-term
basalt bash shell tput
Last synced: 3 days ago
JSON representation
Bash library for terminal escape sequences.
- Host: GitHub
- URL: https://github.com/bash-bastion/bash-term
- Owner: bash-bastion
- License: mpl-2.0
- Created: 2022-02-16T12:16:41.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-30T04:25:06.000Z (about 1 year ago)
- Last Synced: 2024-09-07T10:03:18.073Z (2 months ago)
- Topics: basalt, bash, shell, tput
- Language: Shell
- Homepage: https://bash-bastion.github.io/bash-term/
- Size: 3.51 MB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bash-term
Bash library for terminal escape sequences
## Summary
Includes functions to print standard ANSI escape sequences
## Installation
Use [Basalt](https://github.com/hyperupcall/basalt), a Bash package manager, to add this project as a dependency
```sh
basalt add hyperupcall/bash-term
```## Usage
See [Tweet](https://twitter.com/hyperupcall/status/1553612233388670976)
```sh
# -d means 'done'; that is, reset the style at the end of the string (same as `term.style_reset`)
# -p means 'print'; that is, print the value of "$REPLY" that it sets
# -P is similar to -p, but print with an appended newline
term.color_light_purple 'four'
term.style_strikethrough "$REPLY"
term.style_inverse "$REPLY"
term.style_underline -dp "$REPLY"
```## References
- [vtasni.html](https://www2.ccs.neu.edu/research/gpc/VonaUtils/vona/terminal/vtansi.htm)
- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes/blob/main/index.js)
- [ANSIcode.html](https://www.real-world-systems.com/docs/ANSIcode.html)
- [terminalcodes](https://wiki.bash-hackers.org/scripting/terminalcodes)
- [StackOverflow/20983251](https://stackoverflow.com/a/20983251)
- [dylanaraps/writing-a-tui-in-bash](https://github.com/dylanaraps/writing-a-tui-in-bash)