tui.sh/README.md
2023-03-21 02:48:44 +03:00

47 lines
1.2 KiB
Markdown

# tui.sh
Text-based User Interface library for POSIX compliant shells.
```shell
#!/bin/sh
. ./tui.sh
# Code...
```
See examples.
# Known issues
Currently I've no idea how to force `tput` correctly clear screen on sclroll.
- [ ] Cant use `tui_select` in subshell e.g. `selected=$(tui_select 1 2 3)`
- [ ] `tui_select` doesn't work properly on terminal scroll.
- [ ] `tui_spin -r` doesn't work properly on terminal scroll.
# Roadmap
Functions list may be changed later.
- [ ] `tui_msg` message box with OK button
- [x] `tui_select` menu
- [ ] `tui_checklist` menu with multiple choice
- [ ] `tui_confirm` confirmation menu (yes/no)
- [ ] `tui_input` text input
- [ ] `tui_password` password input
- [x] `tui_spin` spinner
- [ ] `tui_progress` progress bar
- [ ] `tui_print` print formatted text
- [ ] `tui_splitscr` split screen
- [x] `tui_termsize` get actual terminal size, set COLUMNS and LINES
- [x] `tui_curpos` get current terminal cursor position
- [x] `tui_readchar` read characters from keyboard
- [x] `tui_readkey` read keyboard codes
- [x] `tui_optval` cli argument parser
- [x] `tui_fallback` fallback to default terminal settings
# License
Licensed under The Unlicense, see UNLICENSE.