Skip to content

leahneukirchen/vmenu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VMENU(1)                    General Commands Manual                   VMENU(1)

NAME
     vmenu – interactively select an item from a list

SYNOPSIS
     vmenu [-i] [-p prompt] [-l lines] [initial]

DESCRIPTION
     vmenu allows a user to interactively select one item from a list of
     options.  A newline-separated list of items is read from standard input,
     then the list of items is drawn directly onto the terminal so the user
     may select one.  Finally, the selected item is printed to standard
     output.

     For information on actually navigating the menu, see USAGE below.

     -i    Use case-sensitive comparison when filtering items.

     -p prompt
           Display prompt before the list of items.

     -l lines
           The list is displayed with each item on its own line, lines lines
           high (default: 10).  If there are more than lines items in the
           list, the user can scroll through them with the arrow keys.

     initial
           The user can type into a text field to filter the list of items as
           well as scrolling through them.  If supplied, initial is used as
           the initial content of the text field.

USAGE
     vmenu displays the prompt (if any), a text field, and a list of items.

     The following commands are available:

     Enter          selects the currently-highlighted list item and exits.

     Control-\ or Control-]
                    selects the current contents of the text field (even if it
                    does not appear in the list) and exits.

     ESC ESC or Control-C
                    exit without selecting any item.

     Down or Control-N
                    scroll forward through the available list items.

     Up or Control-P
                    scroll backward through the available list items.

     Right or Control-F
                    move the cursor forward through the typed text, and scroll
                    through the available list items.

     Left or Control-B
                    move the cursor backward through the typed text, and
                    scroll through the available list items.

     PageUp or Control-V
                    scrolls to show the previous page of list items.

     PageDown or Meta-V
                    scrolls to show the next page of list items.

     Home or Control-A
                    move the cursor to the beginning of the text field or
                    scroll to the first item in the list.

     End or Control-E
                    move the cursor to the end of the text field or scroll to
                    the last item in the list.

     Meta-B         moves the cursor to the beginning of the current word in
                    the text field.

     Meta-F         moves the cursor past the end of the current word in the
                    text field.

     Tab            copies the content of the selected list item into the text
                    field.  This is almost, but not quite, like tab
                    completion.

     Delete         delete the character in the text field under the cursor.

     Control-D      delete the character in the text field under the cursor,
                    if it is empty, exit without selecting any item.

     Backspace      deletes the character in the text field to the left of the
                    cursor.

     Meta-D         deletes the characters in the text field from the
                    character under the cursor to the next space.

     Control-K      deletes the characters in the text field from the
                    character under the cursor to the end.

     Control-U      delete contents of text field

     Control-W      deletes the characters in the text field from the previous
                    space up to (but not including) the character under the
                    cursor.

     All other non-control characters will be inserted into the text field at
     the current cursor position.

     When there is text in the text field, only list items that include the
     given text will be shown.  If the text contains one or more spaces, each
     space-delimited string is a separate filter and only items matching every
     filter will be shown.

     If the user filters out all the items from the list, then hits Enter to
     select the “currently highlighted” item, the text they typed will be
     returned instead.

EXAMPLES
     Here's a shell-script that allows the user to choose a number from one to
     10:

           NUMBER=$(seq 1 10 | vmenu -p "Choose a number")
           if [ $? -eq 0 ]; then
                   echo "You chose: $NUMBER"
           else
                   echo "You refused to choose a number, or an error occurred."
           fi

DIAGNOSTICS
     The vmenu utility exits 0 if the user successfully selected an item from
     the list, and 1 if the user cancelled.

     If an internal error occurs, the vmenu utility prints a message to
     standard error and exits 1.  Potential error conditions include being
     unable to allocate memory, being unable to read from standard input, or
     being run without a controlling terminal.

SEE ALSO
     dmenu(1), slmenu(1), vis-menu(1)

Void Linux                     November 13, 2017                    Void Linux

About

personal fork of vis-menu/slmenu

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •