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 table for viewers

Add a navigable table. Pipeline rows become the rows; scalars show as one `item` column.

Command Type

built-in

Signature

> tui table {flags} (source)

Flags

  • --columns {list<string>}: Columns to show. Defaults to the columns of the input table.
  • --capture-keys: A chord pressed on the focused table becomes the filter query.
  • --index, -i: Select row indexes instead of rows.
  • --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

  • source: Closure over the --from row whose output is this table's rows.

Input/output types:

inputoutput
nothingtui
tuitui
anytui

Examples

Show a small table and pick a row

> [{name: foo, size: 1}, {name: bar, size: 2}] | tui table --columns [name size] | tui debug --keys down,enter | get selected.name

Check several rows and submit them

> [a b c] | tui table --multi | tui debug --keys [space down space enter] | get selected

A detail table driven by a tree

> ls | tui split [(tui tree --walk) (tui table --from tree-0 {|node| ls $node.name })] | tui run

Keybinding explorer: press a chord to filter

> $env.config.keybindings | tui table --capture-keys --columns [name modifier keycode] | tui run

Notes

Up/Down, j/k, PageUp/PageDown, Home/End, and mouse wheel move the selection. Enter submits the current row (--index submits its index). With --multi, Space checks rows and the selection is the checked rows. A tui search widget filters rows as you type. Streams append while the TUI runs (oldest rows drop after 10,000).

--data gives this table its own rows; --from <id> with a closure makes it a detail view of another widget's highlighted row: tui table --from tree-0 {|node| ls $node.name }. --on-select runs a hook whenever the highlight moves.

--capture-keys turns a chord pressed on the focused table (for example Ctrl+R) into the filter query, so a keybinding table filters to bindings that match that chord. Rows with modifier/keycode fields match reedline-style chords.