Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joknarf/selector
Bash/Zsh/Ksh interactive select menu
https://github.com/joknarf/selector
bash color command-line-tool filter interactive ksh menu ncurses plugin powerline scrolling search select shell shell-extension terminal zsh
Last synced: 6 days ago
JSON representation
Bash/Zsh/Ksh interactive select menu
- Host: GitHub
- URL: https://github.com/joknarf/selector
- Owner: joknarf
- License: mit
- Created: 2023-12-22T12:36:52.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-04-20T12:13:55.000Z (7 months ago)
- Last Synced: 2024-04-27T09:32:05.803Z (7 months ago)
- Topics: bash, color, command-line-tool, filter, interactive, ksh, menu, ncurses, plugin, powerline, scrolling, search, select, shell, shell-extension, terminal, zsh
- Language: Shell
- Homepage:
- Size: 82 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# selector
Shell interactive menu (bash/zsh/ksh compatible)
![image](https://github.com/joknarf/selector/assets/10117818/c3c782eb-ad34-4c31-b806-fbd30270f03a)
## usage
```
usage: selector [-p ] -i |-f [-P ]
args :
-p, --prompt menu prompt
-i, --items menu items \n separated
-f, --file file with items
-F, --filter regexp pattern filter items
-P, --powerline y or n, powerline symbol usage
-a, --autofilter y or n, filter at keystrokes
-k, --keyfunc Custom additional key function
```selector can be used as command line or sourced to be used as function (bash/zsh/ksh compatible)
When sourced, the selected item is available as `$selected`.## demo
![selector](https://github.com/joknarf/selector/assets/10117818/586afdf3-fe0e-4801-b39e-db8efce6918c)
## keys
|key | action |
|--------------------------------|-------------------------------------------------------|
|⇩ | select next item |
|⇧ | select prev item |
|End/⇨ | select last item |
|Home/⇦ | select first item |
|Shift+⇩/PgUp/Ctl+F| next page |
|Shift+⇧/PgDn/Ctl+B| previous page|
|Del/F8 | delete item in menu |
|Esc | exit |
|Ctrl+A | use all screen to display menu |
|Tab | apply/new filter |
|Enter | validate item selected |* filter pattern can be applied entering text
* selection can be done entering item numberdemo usage at:
* [cdhist](https://github.com/joknarf/cdhist) : navigate in directories from command line with arrow keys with dir history (bash/zsh/ksh)
* [redo](https://github.com/joknarf/redo) : replacement for Ctrl+R and Esc+/ to search in command history (bash/zsh)
* [complete-ng](https://github.com/joknarf/complete-ng) : bash command line completion replacement for multiple choices output with interactive menu