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

1.2 KiB

tui.sh

Text-based User Interface library for POSIX compliant shells.

#!/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
  • tui_select menu
  • tui_checklist menu with multiple choice
  • tui_confirm confirmation menu (yes/no)
  • tui_input text input
  • tui_password password input
  • tui_spin spinner
  • tui_progress progress bar
  • tui_print print formatted text
  • tui_splitscr split screen
  • tui_termsize get actual terminal size, set COLUMNS and LINES
  • tui_curpos get current terminal cursor position
  • tui_readchar read characters from keyboard
  • tui_readkey read keyboard codes
  • tui_optval cli argument parser
  • tui_fallback fallback to default terminal settings

License

Licensed under The Unlicense, see UNLICENSE.