A text based UI for Zsh. Similar to ncurses, but different. Also a development environment for Zsh.
Go to file
vladislav doster 2af3eb45ec
Merge pull request #1 from zdharma-continuum/ci/gh-action-lint-workflow
feat: add lint gh action workflows
2023-04-15 23:46:12 -05:00
.github/workflows feat: add lint gh action workflow 2023-04-14 17:11:08 -05:00
demos *-demo-history: Smaller status window 2020-01-02 20:49:33 +01:00
-zui-list-box-loop *box-loop,*input: Support for scrolling in the pop up –> any data size 2017-11-20 16:22:24 +01:00
-zui-log zui-list,-zui-log,*-various: Parameter log_colors -> zui_log_colors 2017-03-15 13:01:11 +01:00
.gitignore .gitignore: Use standard block of Zsh patterns 2019-11-25 19:25:24 +01:00
LICENSE LICENSE 2017-03-16 18:20:58 +01:00
README.md feat: add lint gh action workflow 2023-04-14 17:11:08 -05:00
stdlib.lzui stdlib,*-wrapper: Action-triggered restart doesn't cause screen reset 2017-11-12 19:54:02 +01:00
syslib.lzui {std,sys}lib: Move messages-clearing code to *init2 2017-03-23 15:28:35 +01:00
utillib.lzui -zui_std_to_cmd_line -> -zui_util_to_cmd_line 2017-05-23 05:52:56 +02:00
ZSTYLES.md ZSTYLES.md: Restore a lost line of comment 2017-03-19 15:23:22 +01:00
zui-event-loop Prevent line-deleting glitch with multiline prompt 2020-01-03 23:20:21 +01:00
zui-list zui-list,*-event-loop: Allow more segments in relative anchor spec 2017-11-12 16:23:55 +01:00
zui-list-draw zui-list,*-draw: Allow to customize the palette of 8 colors (s:palette) 2017-10-07 18:42:13 +02:00
zui-list-input *box-loop,*input: Support for scrolling in the pop up –> any data size 2017-11-20 16:22:24 +01:00
zui-list-wrapper stdlib,*-wrapper: Action-triggered restart doesn't cause screen reset 2017-11-12 19:54:02 +01:00
zui-process-buffer No need to prepare (clear) zui-process-buffer* output variables 2017-02-17 14:54:08 +01:00
zui-process-buffer2 No need to prepare (clear) zui-process-buffer* output variables 2017-02-17 14:54:08 +01:00
zui-usetty-wrapper Rename files to start with "zui-" 2017-02-17 12:03:29 +01:00
zui.plugin.zsh plugin.zsh: fg_bold examination could lead to hash access error 2017-09-26 17:27:17 +02:00

ZUI logo

paypal

⬢ ZUI  CGI+DHTML-like User Interface Library for Zsh / ZCurses

License (GPL version 3) MIT License ZSH 4.3.17

Dharma logos

This is a RAD (Rapid Application Development) textual user interface library for Zsh. It in many aspects resembles typical CGI+(D)HTML setup. There are:

  • generators ran on "server" side (basic Zshell-code that is just generating text!),
  • event loop that turns the generated text into document with active elements (buttons, anchors, toggle buttons, text fields, list boxes),
  • mechanism to regenerate document parts from the original generators.

So, a Zshell code generates text. It is then turned into document with hyperlinks. DHTML-like calls are possible that will regenerate document parts on the fly. Page can be also reloaded with input data, just like an HTML page.

A voiced video tutorial shows how to create an application  Nmap network scanner frontend.

Hello World

# Started from Zle or from command line

-zui_std_cleanup deserialize:"zui-demo-hello-world"
-zui_std_init app:"zui-demo-hello-world" app_name:"ZUI Hello World"
emulate -LR zsh -o extendedglob -o typesetsilent -o warncreateglobal
-zui_std_init2 # after emulate -LR

-zui_std_store_default_app_config b:border 1

demo_generator_A() {
    local mod="$1" ice="$2"

    # Content, no hyper-links
    reply=( "Hello World from ${ZUI[YELLOW]}ZUI${ZUI[FMT_END]}! Module $mod, instance $ice." )

    # Non-selectable lines   Hops to jump with [ and ]   Local anchors
    reply2=( )               reply3=( 1 )                reply4=( )
}

## Start application ##
zui-event-loop 1:demo_generator_A

-zui_std_cleanup serialize

Hello World screenshot

Other example which uses list-box: zui-demo-list-box

The API is described at the wiki. Checkout screenshots and Asciinema recordings.

Installation

The plugin is "standalone", which means that only sourcing it is needed. So to install, unpack zui somewhere and add

source {where-zui-is}/zui.plugin.zsh

to zshrc.

If using a plugin manager, then Zinit is recommended, but you can use any other too, and also install with Oh My Zsh (by copying directory to ~/.oh-my-zsh/custom/plugins).

Zinit

Add zinit load zdharma-continuum/zui to your .zshrc file. Zinit will handle cloning the plugin for you automatically the next time you start zsh. To update (i.e. to pull from origin) issue zinit update zdharma-continuum/zui.

Antigen

Add antigen bundle zdharma-continuum/zui to your .zshrc file. Antigen will handle cloning the plugin for you automatically the next time you start zsh.

Oh-My-Zsh

  1. cd ~/.oh-my-zsh/custom/plugins
  2. git clone git@github.com:zdharma-continuum/zui.git
  3. Add zui to your plugin list

Zgen

Add zgen load zdharma-continuum/zui to your .zshrc file in the same place you're doing your other zgen load calls in.