Nushell
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
  • 한국어
GitHub
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
  • 한국어
GitHub
  • Categories

    • Bits
    • Bytes
    • Chart
    • Conversions
    • Core
    • Database
    • Dataframe
    • Dataframe Or Lazyframe
    • Date
    • Debug
    • Default
    • Env
    • Experimental
    • Expression
    • Filesystem
    • Filters
    • Formats
    • Generators
    • Hash
    • History
    • Lazyframe
    • Math
    • Misc
    • Network
    • Path
    • Platform
    • Plugin
    • Prompt
    • Random
    • Removed
    • Shells
    • Strings
    • System
    • Viewers

tui select for viewers

Add a radio list of items, or a checkbox list with --multi.

Command Type

built-in

Signature

> tui select {flags} (items)

Flags

  • --display, -d {oneof<string, closure(any)>}: Column or closure that produces each item's label.
  • --index, -i: Select item indexes instead of items.
  • --id {string}: Widget id.
  • --focus: Start with this widget focused.
  • --data {any}: Data for this widget alone, instead of the outer pipeline's.
  • --from {string}: Id of the table, tree, or select whose highlighted row drives this widget.
  • --on-select {closure(any)}: Hook run when the highlighted row changes; receives the state record.
  • --multi, -m: Space toggles rows; the selection is the checked rows.

Parameters

  • items: Items to choose from. Defaults to the widget's data rows.

Input/output types:

inputoutput
nothingtui
tuitui
anytui

Examples

Pick one of three options

> tui select [small medium large] | tui debug --keys [down enter] | get selected

Check several files by name

> ls | tui select --multi --display name | tui run | get selected.name

Notes

Items come from the list argument, from --data, or from the pipeline. Up/Down move, Space checks (with --multi), Enter submits the chosen item(s); --index submits positions instead.

--display picks the text shown for each item: a column name for records, or a closure over the item. The original item is what gets selected, as with input list --display.