feat(zsh): whiptail helper
This commit is contained in:
parent
7df92af4f1
commit
0756bd5272
18
.zshrc
18
.zshrc
@ -277,6 +277,24 @@ zle -N nnn-file-widget
|
||||
bindkey -M vicmd '\en' nnn-file-widget
|
||||
bindkey -M viins '\en' nnn-file-widget
|
||||
|
||||
# Whiptail helper
|
||||
#
|
||||
menu_choose() {
|
||||
local res title="$1" text="$2"
|
||||
shift 2
|
||||
|
||||
local -a tags
|
||||
for tag;
|
||||
{ tags+=($tag $tag) }
|
||||
|
||||
# see https://stackoverflow.com/questions/1970180/whiptail-how-to-redirect-output-to-environment-variable
|
||||
tag=$(whiptail --title $title --menu $text 25 40 15 $tags --notags 3>&1 1>&2 2>&3 3>&-)
|
||||
res=$?
|
||||
|
||||
echo $tag
|
||||
return $res
|
||||
}
|
||||
|
||||
###
|
||||
### Aliases -- Global & automatic expansion
|
||||
###
|
||||
|
Loading…
x
Reference in New Issue
Block a user