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: 3 months 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 (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-01-31T17:31:51.000Z (3 months ago)
- Last Synced: 2026-02-01T03:38:49.295Z (3 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: https://joknarf.github.io/joknarf-tools
- Size: 109 KB
- Stars: 14
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-zsh-plugins - selector - Make it easy to create selection menus. (Plugins / ZSH on Windows)
- fucking-awesome-zsh-plugins - selector - Make it easy to create selection menus. (Plugins / ZSH on Windows)
README
[](https://joknarf.github.io/joknarf-tools)
[](https://github.com/joknarf/selector/actions/workflows/release.yml)
[](https://github.com/joknarf/selector/releases/latest)
[]()
[](https://shields.io/)
# selector
Shell interactive menu (bash/zsh/ksh compatible)

## features
* dynamic interactive menu with items filtering / selection
* customizable key interaction
* possible display file/folder icons
* customizable colors
## demo

## install
Use a shell plugin manager like the famous [thefly](https://github.com/joknarf/thefly) or use your favorite OS package manager with [release](https://github.com/joknarf/selector/releases/latest) packages
```
fly add joknarf/selector
or
brew install joknarf/tools/selector
dnf install https://github.com/joknarf/selector/releases/latest/download/selector.rpm
...
```
see [joknarf tools](https://joknarf.github.io/joknarf-tools) for package repositories
## 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`.
## keys
|key | action |
|--------------------------------|-------------------------------------------------------|
|▼ | select next item |
|▲ | select prev item |
|End/▶ | select last item |
|Home/◀ | select first item |
|Shift▼/PgUp/CtlF| next page |
|Shift▲/PgDn/CtlB| previous page|
|Del/F8 | delete item in menu |
|Esc | exit |
|CtrlA | 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 number
# customize
selector menu can be customized setting following variables:
```
SELECTOR_FOLDER_ICON=🖿 # folder icon
SELECTOR_FILE_ICON=📄 # file icon
SELECTOR_CASEI=false # case sensitivity filter
SELECTOR_POWERLINE=y # avoid using glyphs with 'n'
SELECTOR_COL_PROMPT="30;90;180" # blue
SELECTOR_COL_TEXT="255;255;255" # white
SELECTOR_COL_TOTAL="32;64;64" # darkggrey
SELECTOR_COL_NUM="36;114;67" # green
SELECTOR_COL_ARROW="41;98;114" # cyan
SELECTOR_COL_ITEM="118;141;255" # light blue
SELECTOR_COL_SELECTED="42;221;244" # light cyan
```
demo usage at:
* [seedee](https://github.com/joknarf/seedee) : navigate in directories from command line with arrow keys with dir history (bash/zsh/ksh)
* [redo](https://github.com/joknarf/redo) : replacement for CtrlR and Esc/ to search in command history (bash/zsh)
* [complete-ng](https://github.com/joknarf/complete-ng) : bash/zsh command line completion replacement for multiple choices output with interactive menu